[BW-PLAY-01] Persist per-profile local remembered audiobook identity #24

Closed
opened 2026-09-18 08:46:37 +02:00 by alexander · 0 comments
Owner

Migrated from GitHub issue #115. Forgejo issue: #24. GitHub source content synchronized on 2026-09-19. Migrated issue references below use Forgejo numbers where an equivalent issue exists; historical references without a Forgejo counterpart remain explicit GitHub links.

Classification

Planned playback-correctness implementation. Blocked on GitHub PR #93.

Product intent

BookWave needs one durable answer to: which audiobook did this phone last play for this profile?

That identity is required by Continue actions, launcher shortcuts, widgets, Quick Settings, headset automation, Android Auto and Garmin controls.

Problem

Current remembered-book selection derives from progress recency. Remote progress activity can therefore change which book this phone thinks it last used, even though the user never played that book locally on this device.

That conflates two different facts:

  • which book this device remembers locally;
  • where playback should resume inside that book.

GitHub PR #93 owns the second fact. This issue owns the first.

Scope

  • Persist one opaque remembered audiobook ID per local profile.
  • Update it only from unambiguous local playback ownership/activity.
  • Survive process death, app restart, offline use and profile switching.
  • Remote realtime/REST progress updates must never change the remembered-book identity.
  • Profile deletion clears its remembered identity.
  • Expose a domain/repository read suitable for startup restore and system actions.

Explicitly out of scope

  • No resume-position policy; GitHub PR #93 owns position freshness.
  • Do not backfill by selecting the maximum remote progress.updatedAt.
  • No title/cover storage simply to remember the identity.
  • No widget/shortcut/headset implementation in this slice.

Dependencies

  • GitHub PR #93 — unified resume freshness. Merge first so book identity and position freshness remain separate owners.

Storage / migration

Use existing durable device-local/profile-scoped storage unless implementation evidence makes another store materially safer.

For existing profiles with no trustworthy local remembered evidence, migrate to no remembered book rather than inventing one from server timestamps.

Privacy / security

Persist only opaque local identity necessary to resolve the book under the profile. Respect profile deletion/lock boundaries.

Automated tests

  • Local playback of A remembers A.
  • Remote progress on B does not replace A.
  • Intentional remote rewind/advance changes position policy only, not remembered identity.
  • Process restart restores A.
  • Profile A/B remembered identities remain independent.
  • Offline startup restores the local remembered identity.
  • Profile deletion removes it.

Device acceptance

  1. Play book A on the phone.
  2. Play/advance book B on another Audiobookshelf client.
  3. Kill/restart BookWave and test offline.
  4. Continue/restore still selects A until this phone locally plays another book.

Effort

Medium.

Risk

Medium-High because this changes startup/Continue ownership.

Sequence

Immediately after GitHub #93. Foundation for #23 BW-SYS-01 and all later system surfaces.

Acceptance criteria

  • Server recency can no longer choose the phone's remembered book.
  • Local remembered identity survives restart/offline/profile switching.
  • Resume position remains delegated to GitHub #93's policy.
> Migrated from [GitHub issue #115](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/issues/115). Forgejo issue: #24. GitHub source content synchronized on 2026-09-19. Migrated issue references below use Forgejo numbers where an equivalent issue exists; historical references without a Forgejo counterpart remain explicit GitHub links. ## Classification Planned playback-correctness implementation. **Blocked on [GitHub PR #93](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/pull/93).** ## Product intent BookWave needs one durable answer to: **which audiobook did this phone last play for this profile?** That identity is required by Continue actions, launcher shortcuts, widgets, Quick Settings, headset automation, Android Auto and Garmin controls. ## Problem Current remembered-book selection derives from progress recency. Remote progress activity can therefore change which book this phone thinks it last used, even though the user never played that book locally on this device. That conflates two different facts: - **which book this device remembers locally**; - **where playback should resume inside that book**. [GitHub PR #93](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/pull/93) owns the second fact. This issue owns the first. ## Scope - Persist one opaque remembered audiobook ID per local profile. - Update it only from unambiguous local playback ownership/activity. - Survive process death, app restart, offline use and profile switching. - Remote realtime/REST progress updates must never change the remembered-book identity. - Profile deletion clears its remembered identity. - Expose a domain/repository read suitable for startup restore and system actions. ## Explicitly out of scope - No resume-position policy; [GitHub PR #93](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/pull/93) owns position freshness. - Do not backfill by selecting the maximum remote `progress.updatedAt`. - No title/cover storage simply to remember the identity. - No widget/shortcut/headset implementation in this slice. ## Dependencies - **[GitHub PR #93](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/pull/93) — unified resume freshness.** Merge first so book identity and position freshness remain separate owners. ## Storage / migration Use existing durable device-local/profile-scoped storage unless implementation evidence makes another store materially safer. For existing profiles with no trustworthy local remembered evidence, migrate to **no remembered book** rather than inventing one from server timestamps. ## Privacy / security Persist only opaque local identity necessary to resolve the book under the profile. Respect profile deletion/lock boundaries. ## Automated tests - Local playback of A remembers A. - Remote progress on B does not replace A. - Intentional remote rewind/advance changes position policy only, not remembered identity. - Process restart restores A. - Profile A/B remembered identities remain independent. - Offline startup restores the local remembered identity. - Profile deletion removes it. ## Device acceptance 1. Play book A on the phone. 2. Play/advance book B on another Audiobookshelf client. 3. Kill/restart BookWave and test offline. 4. Continue/restore still selects A until this phone locally plays another book. ## Effort Medium. ## Risk Medium-High because this changes startup/Continue ownership. ## Sequence Immediately after [GitHub #93](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/issues/93). Foundation for #23 BW-SYS-01 and all later system surfaces. ## Acceptance criteria - Server recency can no longer choose the phone's remembered book. - Local remembered identity survives restart/offline/profile switching. - Resume position remains delegated to [GitHub #93](https://github.com/AlexanderWilhelmsenBerg/Audiobookshelf-Manager-Claude/issues/93)'s policy.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
alexander/Audiobookshelf-Manager-Claude#24
No description provided.