[xwiki-contrib/application-changerequest] c346b2: CRAPP-438: Review invalidation is skipped when a s...
Branch: refs/heads/main Home: https://github.com/xwiki-contrib/application-changerequest Commit: c346b2b0f6ce823c840f1d27b3c6c88d25700b8f https://github.com/xwiki-contrib/application-changerequest/commit/c346b2b0f6... Author: Simon Urli <[email protected]> Date: 2026-09-30 (Wed, 30 Sep 2026) Changed paths: M application-changerequest-default/src/main/java/org/xwiki/contrib/changerequest/internal/cache/ChangeRequestStorageCacheManager.java M application-changerequest-default/src/main/java/org/xwiki/contrib/changerequest/internal/storage/DefaultChangeRequestStorageManager.java A application-changerequest-default/src/test/java/org/xwiki/contrib/changerequest/internal/cache/ChangeRequestStorageCacheManagerTest.java M application-changerequest-default/src/test/java/org/xwiki/contrib/changerequest/internal/storage/DefaultChangeRequestStorageManagerTest.java Log Message: ----------- CRAPP-438: Review invalidation is skipped when a stale change request is served from the storage cache (#194) * Give every change request identifier a generation in ChangeRequestStorageCacheManager, incremented by each invalidation, so that a loader which read the documents before an invalidation can be told apart from one which read them after it * Read that generation through the new startLoading before the documents are read in DefaultChangeRequestStorageManager#load, and hand it back to cacheChangeRequest, which now stores the change request only when the generation is unchanged: an instance built from data that an invalidation has already superseded is dropped instead of being served to every later request * Keep a tombstone carrying the generation instead of removing the entry on invalidation, so that a load started earlier can see that the invalidation happened, and treat the absence of that entry, from an eviction or from invalidateAll, as a reason not to cache * Add unit tests for the cache manager covering the invalidation of a change request being loaded, the disappearance of its entry, and a slow loader finishing after a fresher one * Assert in DefaultChangeRequestStorageManagerTest that the generation is read before the documents and handed back untouched * Explain in ChangeRequestStorageCacheManager#cacheChangeRequest why nothing is stored when the generation does not match or the entry is gone, namely that another save invalidated the change request while it was being loaded, and why that needs no fallback --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> To unsubscribe from these emails, change your notification settings at https://github.com/xwiki-contrib/application-changerequest/settings/notifica...
participants (1)
-
XWiki Notifications