fix(android): batch the multi-camera playback-wall timeline intensity (#599) - #607
Merged
Conversation
The multi-camera playback wall fired one GET /timeline/intensity request per camera in parallel on every scrub re-center, tripping the server's shared rate limiter. Route it through the batched endpoint instead, chunked into <=64-camera requests (MAX_INTENSITY_BATCH in services/api/src/timeline.rs), matching what desktop (#375) and iOS (#377) already do. Falls back to the old per-camera fan-out on a 404 (older server without the batch route) or 400, remembering a 404 per server base so later scrubs skip the doomed batch attempt for the session. Single-camera playback still uses the per-camera GET, unchanged. Fixes #599 Signed-off-by: badbread <badbread@users.noreply.github.com>
badbread
added a commit
that referenced
this pull request
Aug 9, 2026
Bring the [0.2.0] UNRELEASED section current with the final PRs merged after the previous changelog pass: the release version-drift guard (#605), the fresh-install-audit fixes (#606), the Android playback-wall intensity batching (#607), and the desktop-webview embedded-dropdown fix (#608). Added to Fixed and to All merged changes. Still UNRELEASED; dating the header is the release step. Signed-off-by: badbread <badbread@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
timelineIntensityCombined) fired oneGET /timeline/intensityrequest per camera in parallel on every scrub re-center, tripping the server's shared rate limiter (429s) on larger walls.GET /timeline/intensity/batchendpoint instead, chunked into <=64-camera requests (MAX_INTENSITY_BATCHinservices/api/src/timeline.rs), matching what desktop (fix(desktop): chunk motion-intensity batch into <=64-camera requests #375,apps/desktop-flutter/lib/api/motion_timeline_api.dart) and iOS (fix(ios): batch the timeline-intensity fan-out (429 storm at 100+ cameras) #377,apps/ios/Crumb/Features/Playback/PlaybackViewModel.swift) already do.PlaybackViewModel.kt) is untouched — it's legitimately per-camera.Files changed
apps/android/app/src/main/java/video/crumb/app/data/CrumbApi.kt— newtimelineIntensityBatchRetrofit call forGET timeline/intensity/batch.apps/android/app/src/main/java/video/crumb/app/data/Models.kt— newIntensityBatchResponsewire model.apps/android/app/src/main/java/video/crumb/app/data/CrumbRepository.kt—timelineIntensityCombinednow calls the batched endpoint (chunked, with 404/400 fallback and per-server-base memoization); merge math pulled into a standalonecombineIntensityMaxfor testability.apps/android/app/src/test/java/video/crumb/app/data/CombineIntensityMaxTest.kt— new unit tests for the merge math.Test plan
./gradlew assembleDebug) —BUILD SUCCESSFUL../gradlew testDebugUnitTeston dev2 —BUILD SUCCESSFUL, including 4 new passing tests inCombineIntensityMaxTest.Fixes #599