Repository navigation
Conversation
The Audio Language picker wrote `playback.audio_language` as a device-scoped setting that nothing read — not this repo, not the server. The server resolves the initial audio track from the profile's `language` field (silo-server `internal/catalog/detail.go` emits it as `effective_audio_track_index`, which `PlaybackSessionBridge` forwards at session start), and `WireFormatModels.asUserProfile` was deliberately dropping that field on the way into `UserProfile`. Carry `language` through into `UserProfile`, let `UpdateProfileBody` write it, and point the iOS/macOS and tvOS pickers at the profile value through a new `saveAudioLanguage()` on both settings view models. Both pickers now build from the shared `PlaybackLanguageOption.all` list the subtitle and metadata pickers already use, so a language set from the web client (zh/ru/ar/hi) renders instead of showing a blank row, and the two hardcoded nine-entry copies are gone. The choice is profile-wide rather than per-device, so the Streaming footer now says so and the dead device-scoped `PlayerSettings` audio-language state is removed. `PlayerDeviceSettingKey.audioLanguage` stays so "Reset Playback Overrides" still deletes rows written by older builds. Refs Silo-Server/silo-server#376 AI-use disclosure: implemented with Claude Code. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAudio language is moved from device-scoped playback settings to profile-backed storage. iOS and tvOS gain serialized profile saves, dynamic options for unknown codes, updated profile models and wire payloads, cache invalidation, and shared save-state UI. ChangesProfile-backed audio language
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SettingsPicker
participant SettingsViewModel
participant ProfileEndpoint
participant Cache
SettingsPicker->>SettingsViewModel: select audio language
SettingsViewModel->>ProfileEndpoint: update profile language
ProfileEndpoint-->>SettingsViewModel: return updated profile
SettingsViewModel->>Cache: invalidate cached metadata
SettingsViewModel-->>SettingsPicker: render save state and selected value
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Four defects in the new Audio Language picker, all of which end with the server and the UI disagreeing and nothing telling the user. saveAudioLanguage had no in-flight coalescing, unlike saveMetadataLanguage twenty lines above it, which has an explicit queue for exactly this. The picker fires on every change, so two quick selections raced across the await: the second task read an activeProfile.language that the first had not written back yet, concluded nothing had changed, and returned. The server kept the first value, the picker showed the second, and prefSaveState stayed on .saving forever. Both platforms now drain a pending value the way the metadata save does, and record the write before the early return so a follow-up save compares against the right baseline. Neither Playback screen rendered prefSaveState — the only readers were the Subtitles screens — so a failed save was invisible and its message appeared on a different screen. A PIN-gated primary profile gets a 403 here and saw nothing at all. The save-state view is extracted so both platforms' Playback panes report their own result, replacing two near-identical private copies. A nil activeProfile dropped the edit before prefSaveState was ever set, so an offline settings visit silently swallowed every selection. It now reports. The pickers offered twelve languages while the web client writes any of ~37 to the same profile field, and the server stores whatever it is given. A value from outside the twelve rendered as an empty selection on iOS and a literal "—" on tvOS, and the first tap replaced it. Pickers now include whatever the field currently holds — including the `original` sentinel the server honours at profile scope — and name unknown codes via Locale instead of shouting the code back. Separately, every hand-written UserProfile reconstruction dropped isPrimary, because Swift fills an omitted defaulted parameter silently. Latent today since nothing reads activeProfile.isPrimary, but it means the household parent demoted themselves on every preference save. Replaced with a `with(...)` copy helper at all six sites, so the next field added cannot be dropped. The reset footers claimed to reset "this device and profile"; the reset clears device rows and does not touch the profile's audio language. Reworded to match. Verified on macOS 26.5.1 / Xcode 26.4: Silo (iOS Simulator), SiloTV (tvOS Simulator) and SiloMac all build, and the 761-test SiloTests suite passes with no failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
iosApp/iosApp/Screens/Settings/SettingsViewModel.swift (1)
289-390: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffConsider extracting the duplicated profile-language save machinery.
saveAudioLanguage,saveAudioLanguageValue,projectActiveProfileIntoEditor, andoutboundProfileLanguageare now character-for-character identical in both view models, along with theisSaving*/pending*state pairs. The subtle parts (updatingactiveProfilebefore the pending check, reporting failures even when a newer value is queued) now have to stay in sync by hand across platforms.
iosApp/iosApp/Screens/Settings/SettingsViewModel.swift#L289-L390: move the serialize-and-save logic into a shared helper (e.g. aProfileLanguageSaveractor/struct or a protocol extension over anactiveProfile+prefSaveStaterequirement) and delegate to it.iosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swift#L332-L390: delegate to the same helper, keeping only the tvOS-specificItemDetailCache.shared.clearAll()at the call site.Reasonable to defer — the duplication predates this PR for the subtitle/metadata paths and the new code follows it consistently.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@iosApp/iosApp/Screens/Settings/SettingsViewModel.swift` around lines 289 - 390, Extract the duplicated audio-language save machinery into a shared helper and have both view models delegate to it. In iosApp/iosApp/Screens/Settings/SettingsViewModel.swift lines 289-390, move the serialization, pending-value handling, profile update, state reporting, and cache invalidation logic out of saveAudioLanguage, saveAudioLanguageValue, projectActiveProfileIntoEditor, and outboundProfileLanguage; in iosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swift lines 332-390, delegate to the same helper while retaining only the tvOS-specific ItemDetailCache.shared.clearAll() behavior at the call site. Keep the isSaving*/pending* state behavior and subtle activeProfile update and queued-failure handling identical across platforms.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@iosApp/iosApp/Screens/Settings/SettingsViewModel.swift`:
- Around line 289-390: Extract the duplicated audio-language save machinery into
a shared helper and have both view models delegate to it. In
iosApp/iosApp/Screens/Settings/SettingsViewModel.swift lines 289-390, move the
serialization, pending-value handling, profile update, state reporting, and
cache invalidation logic out of saveAudioLanguage, saveAudioLanguageValue,
projectActiveProfileIntoEditor, and outboundProfileLanguage; in
iosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swift lines 332-390,
delegate to the same helper while retaining only the tvOS-specific
ItemDetailCache.shared.clearAll() behavior at the call site. Keep the
isSaving*/pending* state behavior and subtle activeProfile update and
queued-failure handling identical across platforms.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1718538f-648c-4471-9dbe-4d37fea6e6d1
📒 Files selected for processing (12)
iosApp/iosApp/Networking/PlaybackPrefsModels.swiftiosApp/iosApp/Networking/WireFormatModels.swiftiosApp/iosApp/Screens/Player/PlayerSettings.swiftiosApp/iosApp/Screens/Profiles/ProfileModels.swiftiosApp/iosApp/Screens/Settings/PlaybackSettingsView.swiftiosApp/iosApp/Screens/Settings/PrefSaveStateLabel.swiftiosApp/iosApp/Screens/Settings/SettingsViewModel.swiftiosApp/iosApp/Screens/Settings/SubtitleSettingsView.swiftiosApp/iosApp/tvOS/Screens/Settings/TVPlaybackSettingsView.swiftiosApp/iosApp/tvOS/Screens/Settings/TVSettingsComponents.swiftiosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swiftiosApp/iosApp/tvOS/Screens/Settings/TVSubtitleSettingsView.swift
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9113f97959
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| guard activeProfile?.id == profileId, | ||
| pendingAudioLanguageValue == nil else { | ||
| return |
There was a problem hiding this comment.
Finalize a coalesced save that matches the completed write
When the profile starts at A and the user selects B, another value, then B again before the first PUT completes, pendingAudioLanguageValue is B when that PUT succeeds. This guard returns without marking the save complete or invalidating metadata; the queue then drains B, but the equality guard at the start of saveAudioLanguageValue skips it because activeProfile is already B. The UI therefore remains on “Saving…” and previously cached detail metadata remains stale. The identical guard in TVSettingsViewModel.saveAudioLanguageValue has the same behavior.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in a5d1c1b, on both platforms.
The failure mode is narrower than "a newer value is queued" but real: it needs the queued value to equal the one being written (A → B → B before the first PUT returns). At completion pendingAudioLanguageValue is B, so this guard returns before .saved and before the cache flush — and the drained pass then matches the freshly-recorded activeProfile.language and returns at its own equality guard. Nothing ever reports, so the footer sits on "Saving…" indefinitely and cached detail screens keep the old track.
Fixed by recording the write first and then reporting unconditionally, rather than suppressing the report. A queued value that genuinely differs overwrites the message when it lands, so nothing stale survives. saveMetadataLanguage had the same shape via its outboundProfileLanguage(editor…) == newValue comparison and got the same treatment.
| if let state = viewModel.prefSaveState { | ||
| PrefSaveStateLabel(state: state) |
There was a problem hiding this comment.
Keep audio save feedback separate from other profile saves
This footer renders the view model’s shared prefSaveState, which is also mutated by subtitle and metadata saves and is never cleared or tagged with the operation that produced it. Because the same view model persists across settings navigation, saving or failing a subtitle preference and then opening Playback displays that old result under Audio Language as if the audio setting produced it; audio results likewise remain visible on the Subtitles screen. Use operation-specific state or clear/filter the shared state when changing panes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in a5d1c1b, on both platforms.
You're right that the field is untagged and never cleared, and that the view model outlives navigation. Splitting it rather than tagging: audioSaveState / subtitleSaveState / metadataSaveState, each rendered under the row that writes it. Same enum, so PrefSaveStateLabel and TVPrefSaveFooter are unchanged.
One knock-on worth noting: Metadata Language had been borrowing the subtitle trio's footer for its result. With the split it gets its own line on both platforms rather than losing its surface.
| // always refetches `/watch`, so this is display consistency | ||
| // only — it is not what makes the setting take effect. | ||
| ResponseCache.shared.invalidateAllItemMetadata() | ||
| ItemDetailCache.shared.clearAll() |
There was a problem hiding this comment.
Refresh live tvOS detail models instead of only clearing the cache
When Settings is pushed from an item-detail route on tvOS, the underlying TVItemDetailView retains its @State ItemDetailViewModel. clearAll() only removes references from ItemDetailCache; it neither refreshes that live model nor clears its existing detail, and the detail view’s .task(id: contentId) does not restart merely because the settings route is popped. Returning from Settings therefore continues to display the old server-resolved audio track even though this save succeeded. Refresh resident models before eviction or notify the uncovered detail view to reload.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Accurate about the mechanism — clearAll() drops cache references and does not refresh a resident TVItemDetailView's @State model — but not something this PR introduces, so leaving it.
The pre-existing saveMetadataLanguage twenty lines up uses exactly this invalidateAllItemMetadata() + clearAll() treatment and has the same limitation; the audio path was written to match it deliberately. Refreshing live detail models needs a broadcast the settings layer doesn't currently have, and it would want to cover both writes rather than only the new one.
Scope is also narrow: on tvOS, Settings is reached from the rail, so the common path has no resident detail screen behind it. The affected case is a detail screen visited earlier in the same session, and the effect is a stale displayed track — playback refetches /watch and is unaffected. Noted in the PR body as a display-consistency follow-up rather than fixed here.
…ing…" Two defects from the review pass on this PR, each present on both platforms. **The completion path could be skipped for a write that landed.** The success guard returned early unless `pendingAudioLanguageValue` was nil, so re-selecting the value already in flight — A → B → B before the first PUT returns — left B queued at completion time, skipping `.saved` and the cache flush. The drained pass then matched the freshly-recorded `activeProfile.language` and returned at its own equality guard, so nothing ever reported: the footer read "Saving…" indefinitely and cached detail screens kept showing the old track. The write is now recorded first and reported unconditionally; a genuinely newer value overwrites the message when it lands. `saveMetadataLanguage` had the same shape via its editor-value comparison and gets the same treatment. **One untagged save state served three writes.** `prefSaveState` was written by the subtitle, metadata, and audio paths and never cleared, so once the Playback screen started rendering it, a failed subtitle save appeared under Audio Language and an audio result sat pinned under the Subtitles footer. Worse on tvOS, where the rail switches panes on focus alone with no navigation to stale it out. Split into `audioSaveState` / `subtitleSaveState` / `metadataSaveState`, each rendered under the row that produces it — which also gives Metadata Language its own footer line, where before it borrowed the subtitle trio's. Verified on mac-builder (macOS 26.5.1, Xcode 26.4): Silo, SiloTV, and SiloMac all BUILD SUCCEEDED; 761 tests, 0 failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
iosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swift (1)
250-268: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftSerialize subtitle preference writes.
Each change sends a full subtitle payload independently, so requests can complete out of order and restore an older language/mode/forced-subs combination. Queue a snapshot of the latest subtitle payload and only update local state if
activeProfile.idstill matches the request’s captured profile ID.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@iosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swift` around lines 250 - 268, Update the subtitle save flow around the updateProfile call to serialize writes: queue the latest UpdateProfileBody snapshot and process requests sequentially, ensuring newer changes supersede queued older payloads. Capture the profile ID for each request and only update activeProfile and ProfilePrefsStore when activeProfile.id still matches that captured ID.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@iosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swift`:
- Around line 301-322: Update the preferred-metadata save flows around the PUT
success and failure handling to resolve metadataSaveState when the saved profile
is no longer active instead of returning while it remains .saving. Keep the
profile-ID guard around activeProfile mutation, but perform ResponseCache
invalidation and ItemDetailCache clearing after every successful PUT, including
when the active profile changed; apply the same bookkeeping to the corresponding
flow around the second reported range.
---
Outside diff comments:
In `@iosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swift`:
- Around line 250-268: Update the subtitle save flow around the updateProfile
call to serialize writes: queue the latest UpdateProfileBody snapshot and
process requests sequentially, ensuring newer changes supersede queued older
payloads. Capture the profile ID for each request and only update activeProfile
and ProfilePrefsStore when activeProfile.id still matches that captured ID.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3faee9e8-5e83-4e99-9253-41a72bf5fa81
📒 Files selected for processing (7)
iosApp/iosApp/Screens/Settings/PlaybackSettingsView.swiftiosApp/iosApp/Screens/Settings/PrefSaveStateLabel.swiftiosApp/iosApp/Screens/Settings/SettingsViewModel.swiftiosApp/iosApp/Screens/Settings/SubtitleSettingsView.swiftiosApp/iosApp/tvOS/Screens/Settings/TVPlaybackSettingsView.swiftiosApp/iosApp/tvOS/Screens/Settings/TVSettingsViewModel.swiftiosApp/iosApp/tvOS/Screens/Settings/TVSubtitleSettingsView.swift
🚧 Files skipped from review as they are similar to previous changes (6)
- iosApp/iosApp/tvOS/Screens/Settings/TVPlaybackSettingsView.swift
- iosApp/iosApp/Screens/Settings/PrefSaveStateLabel.swift
- iosApp/iosApp/Screens/Settings/SubtitleSettingsView.swift
- iosApp/iosApp/tvOS/Screens/Settings/TVSubtitleSettingsView.swift
- iosApp/iosApp/Screens/Settings/PlaybackSettingsView.swift
- iosApp/iosApp/Screens/Settings/SettingsViewModel.swift
…d-write The post-await `activeProfile?.id == profileId` guards returned while the save state was still `.saving`, so a save that completed after the user switched profiles left the footer reading "Saving…" with nothing able to clear it — the same stranding the previous commit fixed for the queued-value case, reached by a different route. The guards now reset the state to nil: the write is no longer this screen's to report, so the row reports nothing rather than reporting forever. Cache invalidation moves ahead of the guard for the same reason. The PUT succeeded, so the cached item payloads are stale regardless of which profile is active by the time it returns; skipping the flush on the switched-away path left `ResponseCache` holding entries the server had already superseded. Both `invalidateAllItemMetadata()` and `ItemDetailCache.clearAll()` are pure drops that refetch on demand, and a profile switch is if anything a stronger reason to drop them. Applied to the audio and metadata saves on both platforms — the finding was reported against tvOS, but the iOS view model carried the same two guards verbatim. `saveProfilePrefs` needs no change: it has no post-await guard and always resolves its state. Verified on mac-builder (macOS 26.5.1, Xcode 26.4): Silo, SiloTV, and SiloMac all BUILD SUCCEEDED; 761 tests, 0 failures. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Closing this as superseded by the canonical settings architecture introduced by Silo-Server/silo-server#479 and the subsequent Apple settings/Playback V3 work. The current branch is no longer safe to rebase or merge: it moves Audio Language back through the legacy profile DTO and removes the device override path that the canonical contract now owns. The underlying bug is still valid, however: Apple stores |
|
Replacement work is now tracked in Silo-Server/silo-server#595 and implemented in draft PR Silo-Server/silo-server#596. The fix keeps Apple’s picker device-scoped and makes the server include the explicit device ID in canonical catalog and Playback V3 audio-language resolution. |
The Audio Language picker in Settings did nothing. Verified P1 from Silo-Server/silo-server#376.
It wrote
playback.audio_languageas a device setting, but nothing anywhere read that value back — repository-wide it was only loaded, cached, displayed, and written inside the settings layer. No detail, session-start, route-planning, or player-selection path touched it. The server picks the initial audio track from the profile'slanguagefield, whichWireFormatModels.asUserProfilewas explicitly dropping andUpdateProfileBodyhad no way to write.What changed
Carry the profile language through the wire layer
WireFormatModels.swift—Profile.languagenow flows intoUserProfile.languageinstead of being discardedProfileModels.swift—UpdateProfileBodygainslanguageso the client can write itPoint the setting at the profile
SettingsViewModel.swift,TVSettingsViewModel.swift— the device-backedpreferredAudioLanguageis replaced by a profile editor field plussaveAudioLanguage(), which PUTs to/api/v1/profiles/{id}, refreshes the localactiveProfilesnapshot, and flushes the itemResponseCache(and tvOSItemDetailCache) so an already-visited detail screen stops showing the stale trackRemove the dead write path
PlayerSettings.swift— the device-scopedaudioLanguageproperty, setter, registered default, init read, and snapshot entries are gone.PlayerDeviceSettingKey.audioLanguageis kept so "Reset Playback Overrides" still clears rows written by older buildsFix the picker contents
PlaybackSettingsView.swift,TVPlaybackSettingsView.swift,TVSettingsComponents.swift— both pickers build from the sharedPlaybackLanguageOption.alllist the subtitle and metadata pickers already use, deleting two duplicated 9-entry lists. Required, not cosmetic: a language set from the web client (zh/ru/ar/hi) rendered as a blank row before. Footers now say the setting is profile-wide.No server change needed —
PUT /profiles/{id}already acceptslanguagefor self-service, stores it, and returns it. silo-android already readsactiveProfile?.language.Review pass — four defects in the new picker
All four end with the server and the UI disagreeing and nothing telling the user.
No write coalescing.
saveAudioLanguagehad none, unlikesaveMetadataLanguagetwenty lines above it, which has an explicit queue for exactly this. The picker fires on every change, so two quick selections raced across theawait: the second task read anactiveProfile.languagethe first had not written back yet, concluded nothing had changed, and returned. The server kept the first value, the picker showed the second, andprefSaveStatestayed on.savingforever. Both platforms now drain a pending value the way the metadata save does, and record the write before the early return so a follow-up save compares against the right baseline.Failures were invisible. Neither Playback screen rendered
prefSaveState— the only readers were the Subtitles screens — so a failed save showed nothing and its message surfaced on a different screen. A PIN-gated primary profile gets a 403 here and saw nothing at all. The save-state view is extracted so both platforms' Playback panes report their own result, replacing two near-identical private copies.A nil
activeProfileswallowed edits beforeprefSaveStatewas ever set, so an offline settings visit silently discarded every selection. It now reports.The language list was narrower than the field it writes. Listed below as an accepted limit, with the note that an unmatched selection "does not overwrite the stored value" — that turned out not to hold. tvOS rendered a literal
—, iOS rendered blank, and the first tap did replace the stored language. Rather than duplicating the web's ~37-entry table, the pickers now include whatever the field currently holds — including theoriginalsentinel the server honours at profile scope — and name unknown codes viaLocaleinstead of shouting the raw code back.isPrimary, also listed below as deliberately left alone, is fixed. Six sites (three iOS, three tvOS — two of them added by this PR) reconstructedUserProfileby hand and dropped it, because Swift fills an omitted defaulted parameter silently, so the household parent demoted themselves on every preference save. Replaced with awith(...)copy helper: omitting a parameter now means "keep it", so the next field added cannot be dropped.Both reset footers claimed to reset "this device and profile"; the reset clears device rows and does not touch the profile's audio language. Reworded to match what it does.
Second review pass — two defects introduced by the first one
Both were found on this branch by a follow-up review and are fixed in
a5d1c1b. Each was present on both platforms.The coalescing fix could skip the completion path for a write that landed. Guarding
.savedonpendingAudioLanguageValue == nillooked like "don't report a stale result", but it misfires when the queued value equals the one being written — A → B → B before the first PUT returns. At completion B is still queued, so the success path returns before.savedand before flushing the caches; the drained pass then matches the freshly-recordedactiveProfile.languageand returns at its own equality guard. Nothing ever reports: the footer reads "Saving…" indefinitely, and cached detail screens keep the old track — the exact symptom the coalescing was added to eliminate. The write is now recorded first and reported unconditionally, since a genuinely newer value overwrites the message when it lands.saveMetadataLanguagehad the same shape through its editor-value comparison and got the same treatment.One untagged save state served three different writes.
prefSaveStatewas written by the subtitle, metadata, and audio paths and never cleared. That was survivable while only the Subtitles screen read it; making Playback render it too turned it into cross-screen misattribution — a failed subtitle save shows "Couldn't save: …" under Audio Language, and an audio result sits pinned under the Subtitles footer on next visit. Worse on tvOS, where the rail switches panes on focus alone with no navigation to stale it out. Split intoaudioSaveState/subtitleSaveState/metadataSaveState, each rendered under the row that produces it. Metadata Language gains its own footer line as a result; it had been borrowing the subtitle trio's.Two other bot findings were checked and not acted on: extracting the duplicated save machinery is a maintainability nitpick whose duplication predates this PR, and refreshing live tvOS detail models rather than only clearing
ItemDetailCacheis a real but pre-existing display-consistency limit thatsaveMetadataLanguagealready shares — not a regression from this branch, and out of scope here.Verification
Built and tested on mac-builder (macOS 26.5.1, Xcode 26.4) from an isolated
checkout at this branch's exact source state. Re-run after
a5d1c1b.Known limits and follow-ups
playback.audio_languagerows inuser_device_settingsfrom earlier builds are now orphaned. Harmless today, but the settings contract resolves that keyprofile_device → profile, so a stale row would shadow the new profile value — and it would be a value the user set months ago and demonstrably saw no effect from. Needs an explicit server-side migration disposition; deliberately not papered over with a client-side DELETE.Language list is still narrower than the web's.Fixed in the review commit. The claim that an unmatched selection "does not overwrite the stored value" was wrong — tvOS showed—, iOS showed blank, and the first tap replaced it. Pickers now carry the current value plus the twelve.No write coalescing.Fixed in the review commit — the divergence was worse than "land out of order": the second save skipped itself andprefSaveStatestranded on.saving. The coalescing itself then needed a second fix (a5d1c1b): its completion guard could strand the same footer when the queued value equalled the in-flight one.Save results were reported through one shared, untagged field.Fixed ina5d1c1b— split per write, so the Playback screen rendering it no longer misattributes subtitle and metadata results.Pre-existing bug, deliberately left alone:Fixed in the review commit at all six sites (there were six, not four) via aisPrimarydropped on reconstruction.with(...)copy helper. Still latent in effect — nothing readsactiveProfile.isPrimarytoday — but the trap is gone.ItemDetailCache.clearAll()drops cache references but does not refresh a residentTVItemDetailView's@Statemodel, so a detail screen visited earlier in the session can keep showing the old track until it reloads. Pre-existing —saveMetadataLanguagehas had exactly this treatment — and display-only, since playback refetches/watch. Fixing it properly needs a refresh broadcast covering both writes, which is a separate change.Part of Silo-Server/silo-server#376. Server-side contract: Silo-Server/silo-server#479. Supersedes #103, closed when its branch was renamed.
AI Disclosure
claude-opus-5[1m]isPrimarywas dropped at six sites rather than four. Reviewers also confirmed by inspection thatUpdateProfileBody's optional fields cannot wipe siblings —encodeIfPresentomits them and the server patches per-field — so that concern was checked and dropped rather than "fixed". A second review pass over the review commit itself found the two defects fixed ina5d1c1b; both had been introduced by the first pass's fixes, which is the argument for reviewing review commits.Builds and tests were run on mac-builder and the real output is quoted above, rather than reported from the implementing agent, which has no Swift toolchain. One self-inflicted bug was caught before building: both new view structs used
Stateas a generic parameter name, shadowing SwiftUI's@State; renamed toSaveState.Summary by CodeRabbit
New Features
Bug Fixes