[BW-AUTO-01] Make Android Auto browse invalidation shape-aware and snapshot-based #10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Classification
Active follow-up from GitHub PR #78. Canonical roadmap item BW-AUTO-01.
Problem / opportunity
PlaybackService.observeBrowseTreeInvalidationcurrently asksAutoLibraryfor browsable-parent children separately during invalidation. GitHub PR #78 strengthens profile-boundary invalidation and remembers emitted dynamic series/author nodes, but ordinary library mutations can change the actual Android Auto browse shape: empty/non-empty transitions, first/last download, first/last series/author, and shelf availability.Naively invalidating on every persistence write would be correct but noisy. Recomputing each parent from an independent complete repository read also produces avoidable work and inconsistent counts within one sweep.
User value
The car updates promptly when meaningful library/navigation shape changes, never keeps another profile's cached titles, and does not turn a routine library mutation into N complete reads for N emitted series/author nodes.
Scope
Derive the actual exposed browse-tree shape from one profile-bound library snapshot and make that the invalidation fact.
Explicitly out of scope
Dependencies
Architecture seams affected
AutoLibrarybrowse-tree derivation.PlaybackService/MediaLibrarySession.notifyChildrenChangedorchestration.LibraryRepository/ shelf derivation reads.Server / API assumptions
No server API change. The shape is derived from BookWave's current grant-filtered local library/cache. Server refresh/realtime work may cause a new snapshot; it does not directly own Android Auto invalidation policy.
Storage / migration implications
None. The browse shape is derived state, not a new persisted source of truth.
Privacy / security
Profile switching is a privacy boundary, not merely a stale-UI concern. Old-profile dynamic node IDs/titles must be invalidated even if the newly selected profile happens to have the same child counts.
Do not include media titles or raw IDs in diagnostics beyond existing privacy rules simply to fingerprint the shape; stable internal opaque keys/counts/sets are sufficient.
Automated-test level
Pure/JVM/Robolectric tests should cover:
Device / platform acceptance
A JVM test proves shape derivation and which notifications BookWave sends. It does not prove a head unit refreshes the rendered tree.
Verify on DHU and, where practical, the real head unit:
Estimated effort
Medium.
Implementation risk
Medium. Under-invalidation leaks stale/profile content; over-invalidation causes unnecessary database/controller churn.
Recommended sequence
After GitHub #78. Independent of widgets/iOS and does not need to wait for appearance/settings PRs.
Acceptance criteria
Links