View Issue Details

IDProjectCategoryView StatusLast Update
0024821mantisbtcode cleanuppublic2019-03-16 20:20
Reporterjweberhofer Assigned Tocproensa  
PriorityhighSeveritymajorReproducibilityN/A
Status closedResolutionfixed 
Product Version2.17.1 
Target Version2.20.0Fixed in Version2.20.0 
Summary0024821: Wrong caching in version API
Description

While searching solutions for 0017145 I was reviewing the version_api.php -> version_get_all_rows() function and found a potential issue:

The function can be invoked with filters for $p_released and $p_obsolete as well as an additional query $p_inherit. At the first run everything works fine because data are retrieved via a database query. This result is going to be cached.

Subsequent calls don't re-query the database but will re-use the former result. As this is potentially pre-filtered, the cached result-list will potentially contain not all results and therefore return wrong lists.

I could refactor that, please tell me if you are interested in...

TagsNo tags attached.

Relationships

related to 0017145 feedback Need to show obsolete versions in Change Log. 
related to 0022100 closedcproensa Take care of released/obsolete flag when accessing version_cache_array_rows() cache 

Activities

dregad

dregad

2018-10-04 03:53

developer   ~0060734

Hello,

Thanks for your analysis and bug report. Your contribution would be appreciated, please feel free to submit a pull request on GitHub.

Cheers

Related Changesets

MantisBT: master 46c77ace

2019-02-11 19:35:55

cproensa


Committer: vboctor Details Diff
Rewrite project versions cache

Rewrite `version_get_all_rows` so it doesn't perform db queries and rely
in `version_cache_array_rows`.

Rewrite `version_cache_array_rows`to clean up code and improve caching
for non existant projects (eg, ALL_PROJECTS), or projects with no
versions.

Both changes fixes
- A recurrent cache miss when ALL_PROJECT was part of the inheritance
projects scope in a query for versions for a project.
- A potentially wrong cached response for project versions (see 0024821).

Fixes: 0023245, 0024821
Affected Issues
0023245, 0024821, 0025661
mod - core/bug_group_action_api.php Diff File
mod - core/version_api.php Diff File

Issue History

Date Modified Username Field Change
2018-10-03 09:57 jweberhofer New Issue
2018-10-04 03:51 dregad Relationship added related to 0017145
2018-10-04 03:53 dregad Status new => acknowledged
2018-10-04 03:53 dregad Note Added: 0060734
2019-02-12 18:02 cproensa Assigned To => cproensa
2019-02-12 18:02 cproensa Status acknowledged => assigned
2019-02-12 18:21 cproensa Relationship added related to 0022100
2019-02-24 16:41 vboctor Changeset attached => MantisBT master 46c77ace
2019-02-24 16:41 cproensa Status assigned => resolved
2019-02-24 16:41 cproensa Resolution open => fixed
2019-02-24 16:41 cproensa Fixed in Version => 2.20.0
2019-02-24 16:43 vboctor Target Version => 2.20.0
2019-03-05 17:03 cproensa Category bugtracker => code cleanup
2019-03-16 20:20 vboctor Status resolved => closed