Make Android Auto browse invalidation snapshot-based #69
Loading…
Reference in a new issue
No description provided.
Delete branch "mcp/issue-10-auto-browse-snapshots"
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?
Fixes #10
Baseline
main:62342d4cafe846952e1a18d9d64f601d89d034aamcp/issue-10-auto-browse-snapshotsArchitecture
Issue #10 now derives one immutable
AutoBrowseSnapshotfrom one profile-bound accessible-library emission. The snapshot contains:AutoBrowseInvalidationTrackercompares snapshots. Its comparison engine understands only parent identity and ordered child membership; it does not know what Library, Downloads, Recently added, Listen again or Discover mean.Today's visible hierarchy is represented only by
CurrentAutoBrowseSnapshotBuilder, so issue #65 can later replace the adapter with Continue → Series → Authors → Profiles without replacing the snapshot source or comparison/orchestration mechanism. This PR does not expose the #65 hierarchy.One-snapshot orchestration
AutoBrowseSnapshotSourceswitches oneobserveAccessibleBooks(profileId)subscription with the active profile and derives every library-backed parent decision for a candidate sweep from that same emittedList<Book>.The previous profile-switch loop called
AutoLibrary.children(...)once per static/emitted parent, which could perform another complete accessible-library read for every remembered Series/Author node. That fan-out is removed.The few profile-bound parents whose exact count is not a pure library-shape fact (recent root, Chapters and History) resolve their count only on the hard profile boundary. They use the already-derived accessible-id set plus their narrow repositories; they do not re-read the complete accessible library.
Ordinary invalidation semantics
For ordinary library mutations:
Media3 is still notified with
notifyChildrenChanged(parentId, childCount, null).Profile boundary
A profile-generation change ignores shape/count equality and invalidates the union of:
Old dynamic parents absent from the new profile are notified with zero children. Equal counts therefore cannot keep the previous profile's cached rows alive. The implementation observes the existing active-profile owner; it introduces no second profile-switch policy.
The shape fingerprint/logging uses opaque internal ids and counts only. Titles and private media metadata are not logged or required by the comparison engine.
Automated coverage
Focused regression coverage now pins:
Verification
Forgejo's authoritative PR workflow requires an existing PR number to validate
refs/pull/<n>/head, so the run is dispatched after this PR is created.verifyDebug, warnings-as-errors, Detekt and ktlint: pending workflow dispatch.This section will be updated with the exact passing Forgejo Actions run identifier before the PR is reported ready.
DHU / physical Android Auto acceptance still required
Automated tests prove what BookWave publishes, not that a host redraws it.
docs/android-auto-browse-invalidation-acceptance.mdrecords the remaining checks:No DHU or physical-car acceptance is claimed in this PR. The owner plans to combine physical acceptance later with #34, #35, #36, #6 and #65.