You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(audiobooks): track Audiobookshelf plays that apps report only through local sessions - #4268
Closes#4244
Related issue: #3108
Validation tasks: changes #1207 C1 (minor: Activity gains rows for reported Audiobookshelf plays, and their Terminate answers 404; native sessions and their controls are unchanged)
Other clients: N/A (no client change: reported plays reach the admin session list and Playback History that the web admin and the apps already read; Roku has no admin views)
Some Audiobookshelf apps never show up in admin Activity or Playback History. Plappa and Prologue on iOS never call /play. They stream the book's files directly and post their local session to /api/session/local or /api/session/local-all every few seconds. Silo saved the resume position from those posts and recorded nothing else.
A local session the client updated within the last minute is now tracked as a reported play: it shows in Activity while the reports keep coming, ends 90 seconds after the last one, and leaves a Playback History row with the book position and the listening time the client reported.
Approach
A reported play is stored only in Postgres, never in a server's memory. It has an abs_playback_sessions row, keyed by the client's own session id in a new client_session_id column, and a lifecycle start with frontend abs. Because no server holds it:
every API server applies the client's reports to the same play, so there are no per-server copies;
it never counts toward stream or transcode limits, since the app may be playing a downloaded copy;
no media route can load it. Native stream, subtitle, manifest, segment and replan routes need an in-memory session, a signed stream token or a playback attempt, and a reported play has none. The one route that loads by an ABS session id, the public track route, answers 404 for a reported play, and so do /session/{id}/sync and /close.
A report that continues a play whose start is recorded is one UPDATE. A report for a client session with no open play takes a per-account advisory lock, looks for the play again, and then admits a new one. So concurrent first reports on two servers start one play, and the 10-play account cap holds across the cluster. While a play has no lifecycle row (a server died between the row and the start), each report records the start again. A silent row whose start was never recorded gives up its cap slot at the next admission.
The admin session list now also shows open reported plays, read from their start row at the row's position, the same way it lists a native session that no server holds. The lifecycle sweep ends a reported play once no report has arrived for 90 seconds. It closes the row only while no later report has landed, using the database clock, so a report that arrives just after the sweep looked keeps the play going. The history row records the row's position and the listening credited since the row began. A report after the end starts a new play with a new id and its own history row, because lifecycle ids never start again.
A report the client updated longer ago than a minute is offline listening synced late. It only moves the resume position, as before. Reported plays now also count in the ABS listening stats and listening-session list, which matches how real Audiobookshelf keeps synced local sessions.
Validation
Live, on an isolated dev deployment built from the base (7fc39fbd): live local-session reports moved the resume position, while admin sessions and Playback History stayed empty.
Live, on the same deployment rebuilt from the head (4455093d):
Activity listed the play with the client name and the book's length, and the public track answered 404 for its id.
The sweep ended it about 100 s after the last report, with a history row showing position 365 s, 65 s listened (the client's total) and end reason expired.
A later report on the same client session started a new play with a new id that credited only the new listening.
Handler test: a live report starts one play and announces it once, a late sync starts none, and the play's id gets 404 on the public track, /sync and /close. With the public-track check removed, it fails. More handler tests check that a /session/local-all batch names its client from the envelope's deviceInfo, that a malformed optional field (deviceInfo, updatedAt) doesn't reject a sync, and that one request tracks at most ten live sessions. Each fails without its fix.
Postgres tests:
concurrent first reports start one play;
listening counts from the play's starting total and never goes negative;
an older report that arrives late keeps the newer position;
the cap, including a stale unannounced row giving up its slot;
a new play after an end;
listing, ending after silence, and a late report keeping a play alive.
Both are added to scripts/ci/db-contracts.txt.
make lint-changed, go vet ./..., gofmt, go mod tidy -diff, make migrate-validate, make verify-local-paths, make lint-router-recovery, make verify-route-inventory: pass. go test ./... passes except two real-FFmpeg tests (TestRunStatsWithRealFFmpeg, TestCopyRemuxSubtitleRenditionRealFFmpeg) that fail the same way on main on this host. The web gate wasn't run: web/ is unchanged.
Two migrations: three columns on abs_playback_sessions, and a partial unique index built CONCURRENTLY in its own migration.
Admin Stop and Terminate answer 404 for a reported play. No server holds one, and Silo isn't serving its media, so there is nothing to revoke. The app keeps playing either way, and the play ends when its reports stop.
The household sessions view reads only the live-session table, so a reported play shows in admin Activity but not there.
The live window trusts the device clock. A device more than a minute behind, or more than 30 seconds ahead, is never tracked.
An app that pauses for more than 90 seconds ends the play, and resuming starts a new one.
Audiobooks and Audiobookshelf compatibility are beta for 1.0.
Checklist
I read and can explain the complete diff.
This pull request addresses one concern.
Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
The Evidence section shows every change a user can see, or how I checked a change nobody sees.
AI Disclosure
Harness: Claude Code in T3 Code
Tool(s): Claude Code; GitHub CLI; Codex (plan review)
Adversarial review: The plan was reviewed before implementation by gpt-6.1-sol, as an attack, and claude-opus-5-5, as a cut. That round added re-recording a missed start, a cap that counts every open reported play, a listening base taken from the first report, a live window shorter than the idle window, and 404 on /sync and /close. It also reused the sweep's existing end path. A three-finder code review at high effort, on claude-opus-5-5, led to:
a one-statement hot path;
freeing stale unannounced slots;
clamping negative listening;
the row's start time for a late start;
a database-clock close claim.
A simplify pass ran on the change. A background adversarial review by gpt-6.1-sol (reviewed 4455093) found one issue: a /session/local-all batch named its client only on the envelope, so its plays showed as Audiobookshelf. Fixed in b40f883. Kody's reports are fixed too: a late report rewinding the position (5efeaaf), and a malformed optional field rejecting a sync (b871e82). Codex's security review led to a bound on how many live sessions one request tracks (c5753e6, refined in 337ed5e). Three reviewers' ordering findings led to a high-water client total that decides whether a report moves the position, and CodeRabbit's to a 30-second limit on future clock skew (c08d0d2).
Track Audiobookshelf plays reported only through local sessions
Some Audiobookshelf apps report playback only via /session/local reports, never through a /play session. This PR tracks those plays as persisted "reported" plays without creating in-memory sessions.
Adds live-report handling in native_sessions.go: reports within a 1-minute window (plus 30s clock skew) create or update a reported play and announce a detached lifecycle start. Stale or over-budget reports never fail the sync response.
Stores reported plays via new UpdateReportedPlay and StartReportedPlay methods in abs_playback_session_store.go, with a 10-open-play per-account cap, advisory-lock serialization, and cleanup of stale unannounced rows. A migration adds the needed columns and a unique partial index.
Extends the lifecycle sweep in playback_lifecycle_sweep.go to close reported plays silent beyond a 90-second grace and record history from the reported row's facts.
Reported-only sessions return 404 on the public track, session-sync, and session-close endpoints.
Risk: ABSPlaybackSessionStore interface gains required methods, so external implementations must be updated. The lifecycle sweep now also selects and closes reported-play candidates — see loadLifecycleCandidates and endReportedPlay.
…ough local sessions
Plappa and Prologue on iOS never call /play. They stream the book's files
directly and post their local session to /session/local every few seconds,
so Silo kept the resume position but showed nothing in admin Activity or
Playback History.
A live local-session report (client updatedAt within a minute) now records
a reported play: an abs_playback_sessions row keyed by the client's session
id, plus a lifecycle start with frontend abs. No server holds it in memory,
so every API server applies reports to the same play, it stays outside
stream limits, and no media route can load it; the public track route and
the /play sync and close routes answer 404 for its id. A per-account
advisory lock finds or admits the play, so concurrent first reports start
one play and the ten-play account cap holds across the cluster. A report
records the lifecycle start again while the play has none.
Activity lists an open reported play from its start row at the row's
position. The lifecycle sweep ends it 90 seconds after its last report:
closing the row is the claim, so a report that lands after the sweep looked
keeps the play going. History takes the row's position and the listening
the client reported since the row began. A report after the end starts a
new play with its own id and history row.
Closes#4244
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… stale slots
Review fixes for reported Audiobookshelf plays:
- A report that continues a play whose start is recorded is one UPDATE,
with no transaction and no file lookup; the locked admission runs only
when the client session has no open play.
- Admission closes the account's silent rows whose lifecycle start was
never recorded, so they stop holding cap slots for a day.
- Listening is clamped at zero before the integer cast, so a nonsensical
client total cannot fail every report.
- A start recorded late takes the row's start time.
- The sweep's close claim compares report times with the database clock.
- A refusal at the cap logs at debug level; it repeats every few seconds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).
Audiobookshelf local-session reports now create durable reported plays. The changes add report identity and storage, detached lifecycle announcements, activity listing, and sweep-based expiry with history recording.
Changes: Audiobookshelf Reported Play Lifecycle
Layer / File(s)
Summary
Reported-play storage and identity internal/audiobooks/abs/progress.go, internal/audiobooks/abs_playback_session_store.go, migrations/sql/*abs_reported_plays*.sql, internal/audiobooks/abs_playback_session_store_db_test.go
Reported plays now have client-session identity and a listening baseline. Store operations update or create open rows under an account lock and enforce the open-play cap. A unique partial index covers open reported rows. Database tests cover concurrent reports, updates, limits, and re-creation after closure.
Local-session reporting and announcement internal/audiobooks/abs/session_local.go, internal/audiobooks/abs/native_sessions.go, internal/playback/session.go, internal/audiobooks/abs/progress.go, internal/audiobooks/abs/file_handler.go, internal/audiobooks/abs/*_test.go
Live local-session reports update or start report-only plays and announce detached lifecycle starts. Report-only sessions return 404 through track, sync, and close paths. Tests cover repeated and late reports, device metadata, and malformed optional fields.
Lifecycle sweep and activity listing internal/api/handlers/playback_lifecycle_sweep.go, internal/api/handlers/playback_sessions.go, internal/api/handlers/playback_lifecycle_db_test.go, docs/architecture/playback-lifecycle.md, scripts/ci/db-contracts.txt
Open reported plays appear in the activity listing at their reported position. The sweep conditionally ends plays after 90 seconds without a report and records expired history using reported playback totals. Database tests and lifecycle documentation cover listing and expiry.
Live Audiobookshelf reports now create trackable plays. Two narrow edge cases remain: a delayed report can rewind the resume position, and a client with a clock running ahead can cause a duplicate play and history row. Neither blocks the main flow; fix them before or shortly after merge.
Security architecture risk: Low · up to df87d
Reported plays remain account-scoped, with coordinated admission and explicit playback restrictions on updated servers. The main concern is deployment and rollback: older servers can interpret surviving reported-play IDs as playable session IDs unless those rows are isolated or drained.
Retained concerns
Medium · security · inferred: Report-only isolation is not backward-compatible for surviving rows. During mixed-version operation or rollback, an older server reads a new reported-play row as an ordinary ABS session and can serve its public track to someone who knows its ID, provided the row remains open, fresh and catalog-accessible. The head adds the necessary rejection, but the downgrade migration only drops the discriminator columns. Deployment or rollback controls that prevent this reader/writer combination were not established.
Security review details
Security Blast Radius
inferred — The conditional older-reader exposure concerns individual open reported plays, not unrestricted catalog access. Serving still requires the generated session ID, a fresh unclosed row and media accessible to its recorded principal. Local-sync replies return success or client-session results, not the generated playback ID.
Security Findings and Attack Paths
inferred — A holder of a reported-play ID could present it to an older server’s unauthenticated public-track endpoint. That reader ignores the new discriminator and can serve the book without the normal play-admission path. This becomes newly possible because reports now create compatible durable session rows; actual mixed-version reachability was not established.
Trust Boundaries and Controls
observed — On the reviewed head, reported-play ownership comes from the authenticated context rather than payload identity. Store updates include both user and profile, and report-only media and control requests receive the existing not-found response.
Resilience and Maintainability Implications
observed — Repeated detached starts are suppressed by the lifecycle session key. Silent rows with no lifecycle start are reclaimed during admission. Closing the ABS row and recording its end are separate steps, but an open lifecycle remains sweepable after closure, and lifecycle stop plus history persistence share a transaction.
Hardening Proposals
proposed — Use an explicit version-transition protocol: prevent reported-row creation until all serving readers understand report-only isolation, and quiesce creation and close surviving reported rows before routing traffic to older binaries or dropping the discriminator.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
Issue #4244 (direct) has coding requirements. The change set addresses most of them from the summary: (1) a reported play gets an abs_playback_sessions row and a lifecycle start, with frontend abs…
Confirm, by reading the native stream, subtitle, manifest, segment, and replan route handlers, that each loads sessions only from the in-memory manager or a signed token or playback attempt, so a reported-play ID cannot reach media serving.…
Passed checks: 3 passed
Check name
Status
Explanation
Title check
The title names the main change: Audiobookshelf plays that apps report only through local sessions are now tracked. The changeset adds reported-play tracking, persistence, a lifecycle sweep, and 404 g…
Out of Scope Changes check
The changes trace to #4244 or to fixes for review findings on this PR. Lifecycle sweep, session listing, the migrations, the store methods, and AnnounceDetachedStart implement the reported-play path…
Description check
The description is specific and on-topic. It explains that some Audiobookshelf apps (Plappa, Prologue) post local-session reports without calling /play, so Silo never recorded their plays. It then des…
Full details: Title check
Explanation
The title names the main change: Audiobookshelf plays that apps report only through local sessions are now tracked. The changeset adds reported-play tracking, persistence, a lifecycle sweep, and 404 gates, all matching the title. The title follows the conventional commit format and is specific enough for a teammate scanning history.
Full details: Out of Scope Changes check
Explanation
The changes trace to #4244 or to fixes for review findings on this PR. Lifecycle sweep, session listing, the migrations, the store methods, and AnnounceDetachedStart implement the reported-play path. The public-track ReportOnly gate and the /sync and /close 404 implement the required route behavior. The deviceInfo batch fallback and the tolerance of malformed deviceInfo and updatedAt fields fix the review findings the PR lists. The PR also includes reported plays in ABS listening stats and the listening-session list. The issue does not request this. The PR states it as intended, so it is a disclosed consequence of recording these plays as playback sessions, not unrelated work. Reviewers may still want to confirm that scope. Lifecycle documentation and the db-contracts entries support the same behavior.
Full details: Description check
Explanation
The description is specific and on-topic. It explains that some Audiobookshelf apps (Plappa, Prologue) post local-session reports without calling /play, so Silo never recorded their plays. It then describes the fix: reported plays tracked in Postgres, a 90-second sweep expiry, 404 behavior for media routes, the 10-play cap, and the migrations. It also lists validation steps and risks. It clearly relates to the changeset, so it passes.
Full details: Linked Issues check
Explanation
Issue #4244 (direct) has coding requirements. The change set addresses most of them from the summary: (1) a reported play gets an abs_playback_sessions row and a lifecycle start, with frontend abs; (2) the sweep ends a play after 90 seconds of silence, and a later report starts a new play with a new ID and its own history row; (3) one play per client session across servers, through a unique open-play index and a per-account advisory lock; (4) the account cap of 10 is enforced in the same transaction; (5) reported plays do not enter the in-memory session manager, so they do not count toward stream or transcode limits; (6) the public track, /sync, and /close return 404 for a reported-play ID, with handler tests. The issue also requires that stream, subtitle, transcode manifest and segment, and replan routes answer not-found for these plays, enforced where sessions load for serving, with a test. The PR argues this follows from the absence of an in-memory session. The listed tests cover only the public track, /sync, and /close. No test or inspected code path shows the media routes returning not-found for a reported-play ID. Limits: this assessment used the summary and did not read the media route handlers.
Resolution
Confirm, by reading the native stream, subtitle, manifest, segment, and replan route handlers, that each loads sessions only from the in-memory manager or a signed token or playback attempt, so a reported-play ID cannot reach media serving. Add a test that requests each of these routes with a reported-play ID and asserts 404. Without that evidence, the media-route requirement remains unverified.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Please add before-and-after captures of Activity and Playback History with the same test data at both desktop and phone widths, labeled with their builds. The current captures show the desktop after state only; the before API results do not show the before screen state, and the PR does not establish that mobile web is unaffected.
…report arrives late
A report delayed past a newer one rewound the play's position, which
Activity and the history row would show until the next report. The
client's listening total only rises within its session, so a report whose
total is behind the play's keeps the play alive but leaves the newer
position.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
F1 (P3) identifies lost client metadata in /session/local-all reported plays.
Validation: all 691 Goose migrations applied to a disposable Postgres database; the focused ABS, lifecycle, and session compatibility tests passed. A probe with 32 concurrent admissions of distinct client sessions kept ten open reported plays. The batch metadata reproduction used the mounted ABS handler and the Postgres playback-session store.
AI disclosure: Codex in T3 Code, model gpt-6.1-sol.
…n/local-all
Audiobookshelf clients send deviceInfo once on the local-all envelope, not
on each session, so a reported play from a batch showed as Audiobookshelf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad of rejecting the sync
A deviceInfo name that is not a string, or an updatedAt that is not a
number, made the whole /session/local-all batch (or the single
/session/local session) fail to decode, so the client's progress never
synced. Those fields are optional: a malformed one now reads as unknown.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
…racks
A /session/local-all batch could ask for reported-play tracking on every
entry. A client has one live session at a time, so a request now tracks at
most the account cap's worth of live sessions, and none after the cap
refuses a play.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ses a new one
A refused start no longer stops the rest of the request: plays the client
already has open still take their reports, and only new starts stop. A
client session repeated within one request is tracked once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
…tal, and bound future clock skew
The position check compared a report against the floored, age-capped
listening credit, so a late report whose total rounded to the same second,
or one under the cap, could still rewind the position. The row now keeps
the highest client total it saw and moves the position only for a report at
or above it.
A report dated in the future by the device clock counted as live for up to
a minute, so a late copy of a play's last report could start the play again
after the sweep ended it. Future skew is now limited to 30 seconds, which
keeps it and the one-minute past window inside the 90-second idle window.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The end took the start position as the final position less the listening,
which is wrong after a seek. The lifecycle start row holds the position the
play began at; the history row now takes it from there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bugSomething isn't workingevidence-requiredNeeds before-and-after evidence before the Evidence check passesimpact: compatBreaks a supported client or server pathpriority: P2Limited scope, workaround exists, or polishsize/XXL1000–2999 added + deleted lines (all files); change volume, not priority.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Closes #4244
Related issue: #3108
Validation tasks: changes #1207 C1 (minor: Activity gains rows for reported Audiobookshelf plays, and their Terminate answers 404; native sessions and their controls are unchanged)
Other clients: N/A (no client change: reported plays reach the admin session list and Playback History that the web admin and the apps already read; Roku has no admin views)
Some Audiobookshelf apps never show up in admin Activity or Playback History. Plappa and Prologue on iOS never call
/play. They stream the book's files directly and post their local session to/api/session/localor/api/session/local-allevery few seconds. Silo saved the resume position from those posts and recorded nothing else.A local session the client updated within the last minute is now tracked as a reported play: it shows in Activity while the reports keep coming, ends 90 seconds after the last one, and leaves a Playback History row with the book position and the listening time the client reported.
Approach
A reported play is stored only in Postgres, never in a server's memory. It has an
abs_playback_sessionsrow, keyed by the client's own session id in a newclient_session_idcolumn, and a lifecycle start with frontendabs. Because no server holds it:/session/{id}/syncand/close.A report that continues a play whose start is recorded is one
UPDATE. A report for a client session with no open play takes a per-account advisory lock, looks for the play again, and then admits a new one. So concurrent first reports on two servers start one play, and the 10-play account cap holds across the cluster. While a play has no lifecycle row (a server died between the row and the start), each report records the start again. A silent row whose start was never recorded gives up its cap slot at the next admission.The admin session list now also shows open reported plays, read from their start row at the row's position, the same way it lists a native session that no server holds. The lifecycle sweep ends a reported play once no report has arrived for 90 seconds. It closes the row only while no later report has landed, using the database clock, so a report that arrives just after the sweep looked keeps the play going. The history row records the row's position and the listening credited since the row began. A report after the end starts a new play with a new id and its own history row, because lifecycle ids never start again.
A report the client updated longer ago than a minute is offline listening synced late. It only moves the resume position, as before. Reported plays now also count in the ABS listening stats and listening-session list, which matches how real Audiobookshelf keeps synced local sessions.
Validation
Live, on an isolated dev deployment built from the base (
7fc39fbd): live local-session reports moved the resume position, while admin sessions and Playback History stayed empty.Live, on the same deployment rebuilt from the head (
4455093d):expired.Handler test: a live report starts one play and announces it once, a late sync starts none, and the play's id gets 404 on the public track,
/syncand/close. With the public-track check removed, it fails. More handler tests check that a/session/local-allbatch names its client from the envelope'sdeviceInfo, that a malformed optional field (deviceInfo,updatedAt) doesn't reject a sync, and that one request tracks at most ten live sessions. Each fails without its fix.Postgres tests:
Both are added to
scripts/ci/db-contracts.txt.make lint-changed,go vet ./...,gofmt,go mod tidy -diff,make migrate-validate,make verify-local-paths,make lint-router-recovery,make verify-route-inventory: pass.go test ./...passes except two real-FFmpeg tests (TestRunStatsWithRealFFmpeg,TestCopyRemuxSubtitleRenditionRealFFmpeg) that fail the same way onmainon this host. The web gate wasn't run:web/is unchanged.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/issue-4244/
Risks
abs_playback_sessions, and a partial unique index builtCONCURRENTLYin its own migration.Checklist
AI Disclosure
Harness: Claude Code in T3 Code
Tool(s): Claude Code; GitHub CLI; Codex (plan review)
Model(s): claude-opus-5-5 (implementation, code review); gpt-6.1-sol (plan review)
Involvement: Fully AI-generated, human verified
Adversarial review: The plan was reviewed before implementation by gpt-6.1-sol, as an attack, and claude-opus-5-5, as a cut. That round added re-recording a missed start, a cap that counts every open reported play, a listening base taken from the first report, a live window shorter than the idle window, and 404 on
/syncand/close. It also reused the sweep's existing end path. A three-finder code review at high effort, on claude-opus-5-5, led to:A simplify pass ran on the change. A background adversarial review by gpt-6.1-sol (reviewed 4455093) found one issue: a
/session/local-allbatch named its client only on the envelope, so its plays showed as Audiobookshelf. Fixed in b40f883. Kody's reports are fixed too: a late report rewinding the position (5efeaaf), and a malformed optional field rejecting a sync (b871e82). Codex's security review led to a bound on how many live sessions one request tracks (c5753e6, refined in 337ed5e). Three reviewers' ordering findings led to a high-water client total that decides whether a report moves the position, and CodeRabbit's to a 30-second limit on future clock skew (c08d0d2).🤖 Generated with Claude Code
Note
Track Audiobookshelf plays reported only through local sessions
Some Audiobookshelf apps report playback only via
/session/localreports, never through a/playsession. This PR tracks those plays as persisted "reported" plays without creating in-memory sessions.UpdateReportedPlayandStartReportedPlaymethods in abs_playback_session_store.go, with a 10-open-play per-account cap, advisory-lock serialization, and cleanup of stale unannounced rows. A migration adds the needed columns and a unique partial index.ABSPlaybackSessionStoreinterface gains required methods, so external implementations must be updated. The lifecycle sweep now also selects and closes reported-play candidates — seeloadLifecycleCandidatesandendReportedPlay.Macroscope summarized d3a3a5f.