Skip to content

fix(android): batch the multi-camera playback-wall timeline intensity (#599) - #607

Merged
badbread merged 1 commit into
mainfrom
fix/android-batched-intensity
Aug 9, 2026
Merged

fix(android): batch the multi-camera playback-wall timeline intensity (#599)#607
badbread merged 1 commit into
mainfrom
fix/android-batched-intensity

Conversation

@badbread

@badbread badbread commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • The multi-camera playback wall's combined motion overlay (timelineIntensityCombined) fired one GET /timeline/intensity request per camera in parallel on every scrub re-center, tripping the server's shared rate limiter (429s) on larger walls.
  • Route it through the batched GET /timeline/intensity/batch endpoint instead, chunked into <=64-camera requests (MAX_INTENSITY_BATCH in services/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.
  • Falls back to the old per-camera fan-out on a 404 (server predates the batch route) or 400 (unexpected rejection), remembering a 404 per server base so later scrubs skip the doomed batch attempt for the session.
  • Single-camera playback (PlaybackViewModel.kt) is untouched — it's legitimately per-camera.

Files changed

  • apps/android/app/src/main/java/video/crumb/app/data/CrumbApi.kt — new timelineIntensityBatch Retrofit call for GET timeline/intensity/batch.
  • apps/android/app/src/main/java/video/crumb/app/data/Models.kt — new IntensityBatchResponse wire model.
  • apps/android/app/src/main/java/video/crumb/app/data/CrumbRepository.kttimelineIntensityCombined now calls the batched endpoint (chunked, with 404/400 fallback and per-server-base memoization); merge math pulled into a standalone combineIntensityMax for testability.
  • apps/android/app/src/test/java/video/crumb/app/data/CombineIntensityMaxTest.kt — new unit tests for the merge math.

Test plan

  • Built on dev2 (./gradlew assembleDebug) — BUILD SUCCESSFUL.
  • Ran ./gradlew testDebugUnitTest on dev2 — BUILD SUCCESSFUL, including 4 new passing tests in CombineIntensityMaxTest.
  • On-device verification of the playback wall (not yet done in this PR).

Fixes #599

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
badbread merged commit c44960a into main Aug 9, 2026
6 checks passed
@badbread
badbread deleted the fix/android-batched-intensity branch August 9, 2026 18:39
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: use the batched /timeline/intensity endpoint on the multi-camera playback wall

1 participant