Sub albums data refactoring for speed. - #4680
Conversation
📝 WalkthroughWalkthroughFeature 061 adds materialized album buckets, recomputation jobs, a backfill command, three flag-gated API v3 endpoints, identity-aware caching, permission aggregation, and supporting documentation and tests. ChangesAlbum timeline buckets
Estimated code review effort: 5 (Critical) | ~120 minutes Merge Risk: 🟡 Moderate · up to This PR changes album timeline grouping to materialized buckets, adds cached APIs, and recomputes derived data asynchronously. At the current head, unresolved issues can cause incorrect derived writes, inaccurate child-rights flags, duplicate child records, and stale bucket or child responses, so the PR is not merge-ready until these risks are fixed or explicitly accepted. Poem
🚥 Pre-merge checks | ❌ 1❌ Failed checks (1 warning)
Full details: Docstring CoverageExplanation Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 169 functions across 35 files. (3 skipped: 3 unsupported.)
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 |
There was a problem hiding this comment.
Actionable comments posted: 13
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
docs/specs/4-architecture/features/061-album-timeline-buckets/tasks.md (1)
214-214: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd the required documentation footer.
This documentation file ends without a horizontal rule followed by
*Last updated: 2026-08-29*. Add that footer at the bottom of the file.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
docs/specs/4-architecture/features/061-album-timeline-buckets/plan.md (1)
206-206: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winAdd the required documentation footer.
Both documents end without the required horizontal rule and
Last updatedfooter.
docs/specs/4-architecture/features/061-album-timeline-buckets/plan.md#L206-L206: append the footer after the final follow-up.docs/specs/4-architecture/features/061-album-timeline-buckets/spec.md#L352-L353: append the footer after the Spec DSL.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: 2fe0987f-61e5-4e98-a864-aecd0a4f2938
📒 Files selected for processing (39)
app/Console/Commands/RecomputeAlbumBuckets.phpapp/Enum/TitleBucketMode.phpapp/Http/Controllers/Gallery/AlbumBucketController.phpapp/Http/Controllers/Gallery/AlbumChildrenDataController.phpapp/Http/Controllers/Gallery/AlbumChildrenRightsController.phpapp/Http/Controllers/Gallery/AlbumController.phpapp/Http/Controllers/Gallery/AlbumListController.phpapp/Http/Requests/Album/GetAlbumBucketsRequest.phpapp/Http/Requests/Album/GetAlbumChildrenDataRequest.phpapp/Http/Requests/Album/GetAlbumChildrenRightsRequest.phpapp/Http/Resources/V3/AlbumBucketResource.phpapp/Http/Resources/V3/AlbumChildrenDataResource.phpapp/Http/Resources/V3/AlbumChildrenRightsResource.phpapp/Jobs/RecomputeAlbumStatsJob.phpapp/Jobs/RecomputeChildAlbumBucketsJob.phpapp/Listeners/ManagedCacheAlbumListingInvalidator.phpapp/Policies/AlbumQueryPolicy.phpapp/Repositories/AlbumRepository.phpapp/Services/AlbumBucketComputer.phpapp/Services/Cache/CacheKeyProvider.phpdatabase/migrations/2026_08_29_220001_add_bucket_id_to_albums.phpdatabase/migrations/2026_08_29_220002_add_title_bucket_configs.phpdocs/specs/3-reference/api-design.mddocs/specs/3-reference/database-schema.mddocs/specs/4-architecture/features/061-album-timeline-buckets/plan.mddocs/specs/4-architecture/features/061-album-timeline-buckets/spec.mddocs/specs/4-architecture/features/061-album-timeline-buckets/tasks.mddocs/specs/4-architecture/knowledge-map.mddocs/specs/4-architecture/roadmap.mdroutes/api_v3.phptests/Feature_v2/Album/AlbumSortingBucketDispatchTest.phptests/Feature_v3/Album/AlbumBucketsV3Test.phptests/Feature_v3/Album/AlbumChildrenDataV3Test.phptests/Feature_v3/Album/AlbumChildrenRightsV3Test.phptests/Precomputing/CoverSelection/RecomputeAlbumBucketsCommandTest.phptests/Precomputing/CoverSelection/RecomputeAlbumStatsJobBucketTest.phptests/Precomputing/CoverSelection/RecomputeChildAlbumBucketsJobTest.phptests/Unit/Listeners/ManagedCacheAlbumListingInvalidatorTest.phptests/Unit/Services/Cache/CacheKeyProviderTest.php
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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: 61bd733d-ac67-4b43-8fb1-048afa35fc10
📒 Files selected for processing (18)
app/Actions/Tag/GetTagWithPhotosAndAlbums.phpapp/Http/Controllers/Gallery/AlbumBucketController.phpapp/Http/Controllers/Gallery/AlbumChildrenDataController.phpapp/Http/Controllers/Gallery/AlbumChildrenRightsController.phpapp/Http/Controllers/Gallery/AlbumController.phpapp/Repositories/AlbumRepository.phpapp/Services/Cache/CacheKeyProvider.phpdatabase/migrations/2026_08_29_220001_add_bucket_id_to_albums.phpdocs/specs/3-reference/api-design.mddocs/specs/4-architecture/features/061-album-timeline-buckets/plan.mddocs/specs/4-architecture/features/061-album-timeline-buckets/spec.mddocs/specs/4-architecture/features/061-album-timeline-buckets/tasks.mdroutes/api_v3.phptests/Feature_v2/Album/AlbumSortingBucketDispatchTest.phptests/Feature_v3/Album/AlbumBucketsV3Test.phptests/Feature_v3/Album/AlbumChildrenDataV3Test.phptests/Feature_v3/Album/AlbumChildrenRightsV3Test.phptests/Unit/Services/Cache/CacheKeyProviderTest.php
🚧 Files skipped from review as they are similar to previous changes (6)
- tests/Feature_v2/Album/AlbumSortingBucketDispatchTest.php
- tests/Unit/Services/Cache/CacheKeyProviderTest.php
- docs/specs/4-architecture/features/061-album-timeline-buckets/plan.md
- docs/specs/4-architecture/features/061-album-timeline-buckets/spec.md
- routes/api_v3.php
- docs/specs/4-architecture/features/061-album-timeline-buckets/tasks.md
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 140ef0fc-536d-441e-8a2f-ff846ffcb990
📒 Files selected for processing (11)
app/Http/Controllers/Gallery/AlbumBucketController.phpapp/Http/Controllers/Gallery/AlbumChildrenDataController.phpapp/Http/Resources/GalleryConfigs/AlbumConfig.phpapp/Http/Resources/GalleryConfigs/RootConfig.phpapp/Http/Resources/V3/AlbumChildrenDataResource.phpapp/Policies/AlbumQueryPolicy.phpdocs/specs/3-reference/api-design.mddocs/specs/4-architecture/features/061-album-timeline-buckets/spec.mddocs/specs/4-architecture/features/061-album-timeline-buckets/tasks.mdtests/Feature_v3/Album/AlbumBucketsV3Test.phptests/Feature_v3/Album/AlbumChildrenDataV3Test.php
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation