This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-511f041b-69c7-4b31-94b6-7ca0a25e408a XWIKI-22510 Open

XWikiDocument#isFromCache is not reliable

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-e0ac746c-7d3e-4bcb-97e3-5f4e3dac4196 Thomas Mortagne created this issue on 17/Sep/24 03:36
 
Summary: XWikiDocument#isFromCache is not reliable
Issue Type: cid:jira-generated-image-avatar-511f041b-69c7-4b31-94b6-7ca0a25e408a Bug
Affects Versions: 16.7.1
Assignee: Unassigned
Components: Old Core
Created: 17/Sep/24 03:36
Priority: cid:jira-generated-image-static-major-85f3316b-db7d-4ca4-86c4-7de761135de9 Major
Reporter: Thomas Mortagne
Description:

It's set to true only if the document was already in the cache when it was requested to the XWikiCacheStore, but:

  • it's not set to true when the document is loaded from the DB and inserted in the cache
  • it's still true if the document is removed from the cache

All that is making it totally unusable.

It would make a lot more sense for XWikiDocument#setFromCache to be triggered from CacheEntryListener#cacheEntryAdded and CacheEntryListener#cacheEntryRemoved.