Keep realtime progress synchronized while BookWave is foregrounded #40
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
Post-GitHub #93 realtime/library correctness follow-up discovered during physical acceptance. Not part of GitHub PR #93.
User observation
While BookWave is open, progress changed from another Audiobookshelf client does not always appear to update the corresponding BookWave book/shelf immediately. The Audiobookshelf web client does update live when BookWave seeks or syncs, so the expected experience is symmetric: while BookWave is foregrounded, accepted remote progress should appear through the local Room-backed UI without waiting for a full library refresh.
Current implementation
Most of this pipeline already exists:
AbsRealtimeConnectionsubscribes touser_item_progress_updated.ObserveRealtimeUpdatesUseCasesends eachProgressChangedrow throughLibraryRepository.writeProgress(...).DefaultLibraryRepository.writeProgress(...)writes accepted server progress into Room, preserving the existing conflict rules.The current socket collector is started by
HomeViewModel.onVisible()and owned by that ViewModel. That may be narrower than the product expectation of one realtime connection for the active profile while BookWave is foregrounded. A second possible explanation is that the progress row reaches the conflict boundary but is correctly or incorrectly rejected there. The implementation should diagnose which case is occurring rather than bypassing the repository.Audiobookshelf itself currently emits
user_item_progress_updatedafter session progress changes, and its web client commits that pushed progress directly into its user-progress store. BookWave should obtain equivalent low-latency library projection while retaining its stronger local-unsynced conflict protection.Desired contract
While the app is foregrounded and an authenticated profile is active:
Conflict-safety requirement
Do not weaken
DefaultLibraryRepository.writeProgressto make the UI look live.Add redaction-safe diagnostics/tests that distinguish:
Do not log title, server host, token, raw session id, or other private media metadata.
Acceptance criteria
Relationships
PRODUCT_SPECLIB-001 already states: Websocket events update Room; REST refresh is used when websocket is unavailable.Do not merge or broaden GitHub #93 to fix this; implement as an independent follow-up on current
mainafter GitHub #93 lands.