Add album-queries caching - #4602
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAlbum-listing caching now covers paginated children, root listings, tag listings, person listings, pinned listings, and tag-detail albums. New events and listeners invalidate cached data after album, tag, permission, membership, configuration, tree, photo, and computed-data changes. ChangesAlbum Listing Caching
Estimated code review effort: 5 (Critical) | ~120 minutes Merge Risk: 🟠 High · up to This change adds album-listing caching and changes invalidation behavior, but the current head can still serve stale or incorrectly visible listings when cache tags or album updates are processed in the wrong order; required cache settings may also be inaccessible. The PR is not merge-ready until these invalidation and configuration issues are corrected and the required verification is completed. Poem
🚥 Pre-merge checks | ❌ 1❌ Failed checks (1 warning)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 18
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
config/features.php (1)
266-277: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winCorrect the config key names in the comment block.
The comment names
cache_enabled,cache_ttl, andcache_event_logging. The code readsmanaged_cache_enabledandmanaged_cache_ttl(app/Services/Cache/ManagedCacheService.phplines 59 and 63), and this PR addsmanaged_cache_albums_enabled(database/migrations/2026_08_09_000000_managed_cache_albums_config.phpline 16). Operators who follow this comment will look for settings that do not exist.📝 Proposed fix
| When enabled, admins can configure Redis-backed caching from - | the settings panel (cache_enabled, cache_ttl, cache_event_logging). + | the settings panel (managed_cache_enabled, managed_cache_ttl, + | managed_cache_albums_enabled). | Disabled by default — set ENABLE_CACHING=true to activate. - | Note: caching is only active when cache_enabled is also set to 1 in - | the database settings. + | Note: caching is only active when managed_cache_enabled is also set + | to 1 in the database settings.docs/specs/4-architecture/features/053-album-listing-caching/plan.md (1)
257-262: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd the required Markdown footer to every changed documentation file.
Each file must end with an hr line and an italic
Last updatedline.
docs/specs/4-architecture/features/053-album-listing-caching/plan.md#L257-L262: append---and*Last updated: [actual update date]*.docs/specs/4-architecture/features/052-managed-cache-service/tasks.md#L35-L36: append---and*Last updated: [actual update date]*.docs/specs/4-architecture/features/053-album-listing-caching/spec.md#L353-L356: append---and*Last updated: [actual update date]*.
As per coding guidelines:**/*.md: At the bottom of documentation files, add an hr line followed by*Last updated: [date of the update]*.Source: Coding guidelines
docs/specs/4-architecture/features/053-album-listing-caching/tasks.md (1)
165-172: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winSynchronize the required documentation footers.
These Feature 053 documentation updates leave the required footer missing or stale.
docs/specs/4-architecture/features/053-album-listing-caching/tasks.md#L165-L172: append---and*Last updated: [date of the update]*at EOF.docs/specs/4-architecture/roadmap.md#L20-L20: update the footer at Line 127 to the current update date and Feature 053 context.docs/specs/_current-session.md#L138-L157: append the required footer at EOF.As per coding guidelines, “At the bottom of documentation files, add an hr line followed by
*Last updated: [date of the update]*.”Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 41ff4441-58fe-474a-8d33-b7ba8f122ea6
📒 Files selected for processing (91)
app/Actions/Admin/BulkEditAlbumsAction.phpapp/Actions/Album/Create.phpapp/Actions/Album/CreatePersonAlbum.phpapp/Actions/Album/CreateTagAlbum.phpapp/Actions/Album/Delete.phpapp/Actions/Album/Merge.phpapp/Actions/Album/Move.phpapp/Actions/Album/SetProtectionPolicy.phpapp/Actions/Album/Transfer.phpapp/Actions/Albums/Top.phpapp/Actions/Photo/MoveOrDuplicate.phpapp/Actions/Tag/DeleteTag.phpapp/Actions/Tag/GetTagWithPhotosAndAlbums.phpapp/Actions/Tag/MergeTag.phpapp/Console/Commands/FixTree.phpapp/Console/Commands/RecomputeAlbumSizes.phpapp/Console/Commands/RecomputeAlbumStats.phpapp/DTO/Delete/PhotosToBeDeletedDTO.phpapp/Events/AccessPermissionChanged.phpapp/Events/AlbumChildrenChanged.phpapp/Events/AlbumComputedDataUpdated.phpapp/Events/AlbumListingCacheFlushRequested.phpapp/Events/AlbumSaved.phpapp/Events/AlbumTagsChanged.phpapp/Events/BaseAlbumRemoved.phpapp/Events/PersonAlbumSaved.phpapp/Events/TagAlbumSaved.phpapp/Events/UserGroupMembershipChanged.phpapp/Http/Controllers/Admin/Maintenance/DestroyDismissedFaces.phpapp/Http/Controllers/Admin/ModerationController.phpapp/Http/Controllers/Admin/SettingsController.phpapp/Http/Controllers/Admin/UserGroupsManagementController.phpapp/Http/Controllers/AiVision/FaceController.phpapp/Http/Controllers/Gallery/AlbumController.phpapp/Http/Controllers/Gallery/SharingController.phpapp/Jobs/ApplyNsfwAlbumSensitivityJob.phpapp/Jobs/RecomputeAlbumSizeJob.phpapp/Jobs/RecomputeAlbumStatsJob.phpapp/Listeners/ManagedCacheAlbumListingInvalidator.phpapp/Listeners/ManagedCacheUserListingInvalidator.phpapp/Listeners/RecomputeAlbumSizeOnAlbumChange.phpapp/Listeners/RecomputeAlbumStatsOnAlbumChange.phpapp/Observers/PhotoObserver.phpapp/Policies/AlbumPolicy.phpapp/Providers/EventServiceProvider.phpapp/Repositories/AlbumRepository.phpapp/Services/Cache/CacheKeyProvider.phpapp/Services/Cache/ManagedCacheService.phpconfig/features.phpdatabase/migrations/2026_08_09_000000_managed_cache_albums_config.phpdocs/specs/4-architecture/features/052-managed-cache-service/tasks.mddocs/specs/4-architecture/features/053-album-listing-caching/plan.mddocs/specs/4-architecture/features/053-album-listing-caching/spec.mddocs/specs/4-architecture/features/053-album-listing-caching/tasks.mddocs/specs/4-architecture/knowledge-map.mddocs/specs/4-architecture/open-questions.mddocs/specs/4-architecture/roadmap.mddocs/specs/_current-session.mdtests/AssistedVision/NsfwClassification/ApplyNsfwAlbumSensitivityJobTest.phptests/Feature_v2/Album/AlbumMergeTest.phptests/Feature_v2/Album/AlbumMoveTest.phptests/Feature_v2/Album/AlbumRenameTest.phptests/Feature_v2/Album/AlbumSetCoverTest.phptests/Feature_v2/Album/AlbumSetHeaderTest.phptests/Feature_v2/Album/AlbumSetPinnedTest.phptests/Feature_v2/Album/AlbumTagPersonSavedEventTest.phptests/Feature_v2/Album/AlbumTransferTest.phptests/Feature_v2/Album/AlbumUpdateFocusTest.phptests/Feature_v2/Album/AlbumUpdateTest.phptests/Feature_v2/Album/SharingTest.phptests/Feature_v2/Album/TagAlbumSetCoverTest.phptests/Feature_v2/BulkAlbumEdit/PatchTest.phptests/Feature_v2/Settings/GetAllSettingsTest.phptests/Feature_v2/Settings/UpdateSettingsTest.phptests/Feature_v2/Tags/DeleteTagsTest.phptests/Feature_v2/Tags/GetTagsTest.phptests/Feature_v2/Tags/MergeTagsTest.phptests/Feature_v2/UserGroup/UserGroupsManagementTest.phptests/ImageProcessing/Photo/PhotoDeleteTest.phptests/Precomputing/CoverSelection/EventListenersTest.phptests/Precomputing/CoverSelection/RecomputeAlbumStatsJobTest.phptests/Precomputing/SizeComputations/RecomputeAlbumSizeJobTest.phptests/Unit/Actions/Album/DeleteTest.phptests/Unit/Actions/Album/SetProtectionPolicyTest.phptests/Unit/Actions/Album/SetSmartProtectionPolicyTest.phptests/Unit/Actions/Albums/TopTest.phptests/Unit/Console/Commands/FixTreeTest.phptests/Unit/Listeners/ManagedCacheAlbumListingInvalidatorTest.phptests/Unit/Listeners/ManagedCacheUserListingInvalidatorTest.phptests/Unit/Repositories/AlbumRepositoryTest.phptests/Unit/Services/Cache/ManagedCacheServiceTest.php
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fcce63cf-5fd5-4a18-a47c-20b41cc72b28
📒 Files selected for processing (10)
app/Actions/Albums/Top.phpapp/Actions/Tag/GetTagWithPhotosAndAlbums.phpapp/Repositories/AlbumRepository.phpapp/Services/Cache/CacheKeyProvider.phpapp/Services/Cache/ManagedCacheService.phptests/AssistedVision/NsfwClassification/ApplyNsfwAlbumSensitivityJobTest.phptests/Feature_v2/Settings/GetAllSettingsTest.phptests/Unit/Listeners/ManagedCacheAlbumListingInvalidatorTest.phptests/Unit/Listeners/ManagedCacheUserListingInvalidatorTest.phptests/Unit/Services/Cache/ManagedCacheServiceTest.php
🚧 Files skipped from review as they are similar to previous changes (9)
- tests/Feature_v2/Settings/GetAllSettingsTest.php
- tests/Unit/Listeners/ManagedCacheUserListingInvalidatorTest.php
- app/Repositories/AlbumRepository.php
- tests/AssistedVision/NsfwClassification/ApplyNsfwAlbumSensitivityJobTest.php
- app/Actions/Tag/GetTagWithPhotosAndAlbums.php
- app/Actions/Albums/Top.php
- app/Services/Cache/CacheKeyProvider.php
- tests/Unit/Services/Cache/ManagedCacheServiceTest.php
- tests/Unit/Listeners/ManagedCacheAlbumListingInvalidatorTest.php
Summary by CodeRabbit