View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0020551||mantisbt||code cleanup||public||2016-01-29 00:33||2016-08-28 01:12|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Target Version||1.3.1||Fixed in Version||1.3.1|
|Summary||0020551: Why does user_cache_database_result() return cache value?|
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.
|Tags||No tags attached.|
sometimes i think a more structured cache (not just random global vars) may be a benefit.
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.
I stumbled too often over this function and did not understand what it does.
MantisBT: master-1.3.x 694873e7
2016-08-22 14:56:52Details 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.
|mod - core/user_api.php||Diff File|
|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|