View Issue Details

IDProjectCategoryView StatusLast Update
0020551mantisbtcode cleanuppublic2016-08-28 01:12
ReportervboctorAssigned Toatrol 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.3.0-rc.1 
Target Version1.3.1Fixed in Version1.3.1 
Summary0020551: Why does user_cache_database_result() return cache value?
Description

This method is called to put rows into the cache? Why does it check for the row in the cache and return it? I would have expected it to always update the row and not return it, just have a void return.

Currently if the passed row is newer than the one in the cache, the cache will maintain the old one which is now stale.

Probably not a huge deal since the request will be stale for this just single request, but it is not right.

TagsNo tags attached.

Activities

cproensa

cproensa

2016-01-29 14:04

developer   ~0052444

sometimes i think a more structured cache (not just random global vars) may be a benefit.
I got to think about it when we cache info regardless of access controls, sometimes its different "as seen from a reporter", than it's to core system functionality.
Sometimes we would want to perform operations with contolled/disabled cache (mass treatment of data, one pass)
...etc

dregad

dregad

2016-01-30 19:15

developer   ~0052451

I had a quick look, and it appears that user_cache_database_result() is only called after user_search_cache() failed to return anything, which implies that the cache is not set for the record being added.

That being said, I don't see the rationale behind the function's current behavior either.

atrol

atrol

2016-08-22 15:02

developer   ~0053879

Last edited: 2016-08-22 15:12

View 2 revisions

I stumbled too often over this function and did not understand what it does.

PR https://github.com/mantisbt/mantisbt/pull/866

Related Changesets

MantisBT: master-1.3.x 694873e7

2016-08-22 14:56:52

atrol

Details Diff
Cache latest data in function user_cache_database_result

The functions did not return a value in all cases.
There is no place in code where the return value of the function is used.

The cache was not updated with latest data if's been set before.

Fixes 0020551
mod - core/user_api.php Diff File

Issue History

Date Modified Username Field Change
2016-01-29 00:33 vboctor New Issue
2016-01-29 14:04 cproensa Note Added: 0052444
2016-01-30 19:15 dregad Note Added: 0052451
2016-01-31 11:30 vboctor Assigned To => vboctor
2016-01-31 11:30 vboctor Status new => assigned
2016-08-22 15:02 atrol Note Added: 0053879
2016-08-22 15:02 atrol Assigned To vboctor => atrol
2016-08-22 15:12 atrol Note Edited: 0053879 View Revisions
2016-08-23 03:57 atrol Changeset attached => MantisBT master-1.3.x 694873e7
2016-08-23 03:57 atrol Status assigned => resolved
2016-08-23 03:57 atrol Resolution open => fixed
2016-08-23 03:57 atrol Fixed in Version => 1.3.1
2016-08-23 03:58 atrol Target Version => 1.3.1
2016-08-28 01:12 vboctor Status resolved => closed