Repository navigation
Conversation
…g it A subtitle or audio choice made in the web player while offline joined the per-title write queue behind an earlier save still waiting for its response. Once that response arrived after reconnect, the offline choice went out and could replace a newer choice the profile made in another browser. Silo-Server#4534 refused offline choices only in the item page's hooks. runTrackPreferenceWrite, which every caller enters, now refuses a choice made offline at once with SettingWriteOfflineError, so nothing is sent after reconnect. The player's audio choice shows that error's localized notice in its existing failure toast; its subtitle choice stays best effort and silent. Closes Silo-Server#4576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedThis organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing. Next included review available in 51 minutes. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
The player's subtitle save swallowed every failure, so the offline refusal added for Silo-Server#4576 left the viewer with no notice. It now shows the offline notice settings pages use; other failures stay best effort. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick104
left a comment
There was a problem hiding this comment.
One finding from the maintainer review of e37c0f5. I'm pushing the fix as a commit on this branch, so there's no need to change it yourself.
Minor: an audio pick made offline doesn't share the offline notice's toast id (web/src/player/hooks/useTrackChoicePersistence.ts, saveAudioChoice, line 49; outside the diff's hunks, so it's here rather than inline).
Trigger: pick two audio tracks while offline, or an audio track and a subtitle track. Impact: since this PR, the audio pick's error is a SettingWriteOfflineError, and toast.error(readableErrorText(...)) shows its message with no id. Each offline audio pick stacks its own "You're offline, so this change wasn't saved" toast, and an audio pick plus a subtitle pick shows that sentence twice. The subtitle path and the settings pages show it once for a burst through the setting-write-offline id.
Repair: call toastSettingWriteError(err, t("web.player.tracks.saveAudioFailed")) from settingWriteOffline.ts. It shows the deduped offline notice for an offline refusal, and the same readableErrorText toast as now for everything else. The fix adds one assertion to the existing audio-pick test in transportFailureToasts.test.tsx.
🤖 Claude Code (claude-opus-5-5)
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Maintainer review summaryReviewed head: 93cb0ed (the PR's e37c0f5 plus one fix commit). Updated after a second pass on the same head. Fit: 9/10 · Readiness: 9/10 — ready A player track choice made offline could wait behind an unanswered save and go out after reconnect, replacing a newer choice the same profile made in another browser (#4576). Refusing offline choices in Addressed
Verification
Review notesCode review and a council round on 93cb0ed found nothing that blocks merging. Answered without a change:
Optional nits, none needed for merge: the doc comment on A similar gap that predates this PR exists in the subtitle delay control: a delay nudge made offline can queue behind a pending save and go out after reconnect. It is outside this PR and has been reported to the maintainers separately. Validated featuresValidation tasks: none. The passed web cases nearest the diff, #1181 C1 (independent preferences per profile) and #1221 C1 (device and override auditing), are unaffected. #1159 (subtitle playback, web) has no passed cases. Other checks
🤖 Claude Code (claude-opus-5-5) |
Depends on: none. Merge order: none. Follows #4534 (merged), which refused offline choices on the item page.
Problem
Closes #4576
Related issue: #4534
Validation tasks: none
Other clients: Apple N/A (keeps and retries offline picks by design); Android N/A (same); Roku N/A (doesn't save track choices)
In the web player, a subtitle or audio choice made while the browser was offline could still be sent after the connection came back, and then replace a newer choice the same profile made in another browser:
runPlayerTrackPreferenceWrite→runTrackPreferenceWriteinweb/src/player/utils/trackPreferenceWrites.ts).#4534 refuses offline choices in the item page's hooks (
settingWriteOptions), so the player was still affected.Approach
runTrackPreferenceWrite, where every caller enters the queue, refuses a choice made offline at once, with the sameSettingWriteOfflineErrorthe item page's writes use. This is the move the issue suggests, adapted to where fix(web): fail offline admin setting and subtitle/audio saves instead of replaying them #4534 actually put its check.reportOfflineSettingFailure, one toast for a burst); other failures stay silent.Validation
trackPreferenceWrites.test.ts, "a choice made offline is refused at once and not sent after the earlier write settles": with a slow earlier write pending, an offline choice rejects withSettingWriteOfflineErrorand is never sent after reconnect. Onmainit never rejects and the test times out; with this change it passes.transportFailureToasts.test.tsx, "show the offline notice for a player subtitle pick made offline": the pick shows the offline notice and sends nothing. It fails on d56748b (before the review fix). That file'susePlayerConfigmock now returns a full config, which the subtitle path reads; the audio test mocks its send and doesn't read it.pnpm exec vitest run src/player src/hooks/queries src/pages/ItemDetail*: 131 files, 1404 tests passed (before the review fix). After it,src/hooks/queries src/player: 126 files, 1372 tests passed.tsc -b --noEmit, eslint and prettier on the changed files: clean.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5485/ (before/after of a subtitle picked offline in the player)
In the browser (headless Edge, Vite dev server, local Silo server, offline by DevTools network emulation), picking a subtitle offline shows only "Playback unavailable" on main c24e4b2. With e37c0f5 it also shows "You're offline, so this change wasn't saved". The load failure is unchanged. Same on two runs of each.
The queued-write race itself needs a save held pending across a reconnect and a newer choice in another browser being replaced, which a still image can't show; the test above shows it. The audio choice's existing failure toast now reads the localized "change not saved" notice when offline instead of a transport error.
On
main(0a631fb), with the new test:With this PR:
Tests 3 passed (3).Risks
Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Reject offline player track-preference writes instead of queuing them
runTrackPreferenceWritein trackPreferenceWrites.ts now checks the online state before touching the per-key pending-write queue. Offline writes reject immediately withSettingWriteOfflineErrorand are never sent.useTrackChoicePersistencein useTrackChoicePersistence.ts routes audio write failures through the shared setting-write error notifier and subtitle write failures through the shared offline-failure reporter, instead of swallowing errors or showing inline toast text.Macroscope summarized 93cb0ed.