Repository navigation
Description
Unify roaming and device-scoped user settings across web, Apple, and Android
Summary
User settings currently have good backend primitives—profile defaults, library overrides, per-series choices, and profile+device overrides—but the three clients do not use those scopes consistently. The result is that controls with the same visible meaning can roam in web, remain device-specific in native clients, silently fail to sync, or have no playback effect.
This was verified against:
silo-server3fd0912cb3fe15cc364f3dd04095c2e39db0bef0silo-apple120f493593119e71dfb1247dde0f89c55d46c1d0silo-android5c6439cebe753103c3a12cca7d1d152c5d6e35ab
Expected portability model
The product should have one documented precedence model:
- Profile-wide defaults roam to every client and new browser session.
- Optional library defaults override the profile for one library.
- Explicit series/item track choices override both.
- Device overrides apply only to one profile on one stable device/browser identity.
- OS- or hardware-specific settings remain local-only.
An incognito browser intentionally receives a new device ID. Profile/library/series preferences should therefore carry over, while device overrides should fall back cleanly. We should not weaken private-browsing isolation by reusing the regular browser's device ID.
Verified findings
P1: Apple Audio Language is saved but never consumed by playback
silo-apple/iosApp/iosApp/Screens/Settings/PlaybackSettingsView.swift:46-62exposes the picker.silo-apple/iosApp/iosApp/Screens/Settings/SettingsViewModel.swift:123-126forwards it toPlayerSettings.setAudioLanguage.silo-apple/iosApp/iosApp/Screens/Player/PlayerSettings.swift:372-375writesplayback.audio_languageas a device setting.- Repository-wide Apple usage shows
PlayerSettings.audioLanguageis only loaded, cached, displayed, and written in the settings layer; no detail, session-start, route-planning, or player-selection path consumes it. - Server initial audio selection instead reads
Profile.Languageininternal/catalog/detail.go:2869-2907andinternal/api/handlers/playback.go:1398-1428. - Apple decodes the full profile
language, butiosApp/iosApp/Networking/WireFormatModels.swift:36-49deliberately drops it when converting toUserProfile;UpdateProfileBodyalso cannot write it.
Impact: changing a visible Apple setting does not change initial audio selection. A profile spoken-language choice made on web can affect Apple indirectly through the server-resolved track index, but Apple cannot display or edit that roaming value.
P1: Android's copied settings contract has drifted from the server
- Android uses
player.next_up_prompt_secondsinshared/.../PlaybackSettingsKeys.kt:16; server and Apple useplayback.next_up_prompt_seconds. - Android clamps playback speed to
4.0inAndroidPlayerSettingsStore.kt:280-285, and its unit test explicitly expects4.0; the server rejects values above3.0ininternal/api/handlers/settings.go:249-252. - Android includes unregistered keys such as
player.match_frame_rate,player.sleep_timer_default_minutes, and individualsubtitle.*fields inPlaybackSettingsKeys.DeviceSettings. The server only accepts registered device-scope keys (keyUsesDeviceScopeinsettings.go:742-745), so writes/deletes for unknown keys return a bad request. - Android defaults Profile 7 HDR10 fallback to
truebefore hydration (AndroidPlayerSettingsStore.kt:143-145); server and Apple default it tofalse.
Impact: some Android settings remain local while appearing server-backed, some reset operations generate rejected requests, and offline/pre-hydration behavior differs from other clients.
P1: Native settings delivery loses or mis-scopes failed operations
Android:
ServerSettingsFlusher.kt:70-82removes pending operations before sending them.ServerSettingsFlusher.kt:87-102only logs API/network errors and never requeues them.- Set operations pass the queued
profileId, but delete operations calldeleteDeviceSetting(key)without it (ServerSettingsFlusher.kt:89-94;SettingsApi.kt:63-79). A queued delete can therefore use whichever profile is active when it is sent.
Apple:
PlayerSettings.pendingDeviceSettingValuesis an in-memory map keyed only by setting key (PlayerSettings.swift:211-214). It is not keyed by server/profile/device and is not persisted.- Failed writes remain only in that map (
PlayerSettings.swift:494-524). Profile selection changes the active auth scope beforerefreshFromServer()flushes pending writes (ProfileSelectionViewModel.swift:49-65). A failed old-profile operation can therefore be retried against the newly selected profile; terminating the app loses it entirely.
Impact: the UI can show a locally changed value that never reaches the server, later reverts after refresh, or is applied/deleted in the wrong profile scope.
P2: The same semantic preferences exist at incompatible scopes
Examples:
| Preference | Web | Apple / Android |
|---|---|---|
| Spoken/audio language | profile language |
device playback.audio_language |
| Preferred quality | profile quality_preference |
device playback.preferred_quality |
| Auto-skip intro/credits | profile fields | device settings |
| Subtitle language/mode/forced | profile fields | profile fields |
| Subtitle appearance | device override | device override |
Web edits the profile fields in web/src/pages/settings/PlaybackSettings.tsx:102-292; Apple edits device settings in SettingsViewModel.swift:117-150; Android does the same in SettingsViewModel.kt:370-388.
Impact: users cannot predict whether a setting follows them into incognito or another client. Existing device overrides can also mask a changed profile default.
P2: Profile preference writes lack equivalent validation
HandleUpdateProfiledecodes and persistsquality_preference,language,subtitle_language, andsubtitle_modewithout validating their allowed values or lengths (internal/api/handlers/profiles.go:476-590).- Device settings validate scope, enum/range, and lengths through
settingsRegistry. - Library preferences independently validate subtitle mode in
internal/api/handlers/library_playback_prefs.go:99-108.
Impact: stale clients or direct API callers can insert values that different clients interpret differently.
P2: Web appearance caches can leak between accounts on one browser
- Date/time preferences tag the local warm cache with the authenticated user ID and reject another account's cache (
web/src/hooks/useDateTimeFormat.tsx:47-82). - Theme, text scale/weight, contrast, custom variables, and custom CSS read unowned localStorage values and keep them when the newly authenticated account has no server value (
useTheme.tsx:49-93;useCustomTheme.ts:31-71).
Impact: a second account using the same regular browser can inherit the prior account's appearance until it explicitly saves its own value. Incognito itself starts with an empty cache and is not the leaking case.
P3: Private sessions create durable device-registry clutter
- Every effective-settings read registers the supplied device ID (
internal/api/handlers/settings.go:551-582). - Web private sessions generate a fresh localStorage device ID (
web/src/api/client.ts:85-104). user_devicesrows have no retention/expiry path; they are removed only with profile/account deletion. Listing is unbounded (internal/userstore/pgstore/settings.go:89-136).
Impact: repeated private sessions accumulate indistinguishable browser devices in admin views.
UX findings
Apple's subtitle settings are a good precedent and should be preserved:
- the language/mode/forced section is explicitly labeled
Profile; - appearance explains
Saved on the server for this profile on this device; - OS caption matching is clearly local to the device.
Extend that pattern to Playback and to web/Android:
- label every setting
All devices for this profile,This device/browser, orLocal to this app; - expose
Use profile defaultfor settings that support an optional device override; - show
Saved,Sync pending, andCouldn't syncinstead of treating queued native writes as complete; - explain that private windows are new devices and therefore use profile defaults.
Recommended implementation order
- Fix Apple audio-language behavior and Android key/default/range mismatches.
- Make native pending operations durable and scope them by server + profile + device; pass explicit profile IDs on both set and delete.
- Publish one additive server-owned settings schema/capability contract containing key, scope, default, allowed values/ranges, and portability description.
- Decide and migrate the duplicate profile/device semantics, preserving
/api/v1compatibility. Recommended spoken language model: roaming profile default with an optional explicit device override. - Validate profile preference payloads using the same canonical definitions.
- Owner-tag or clear all web local warm caches on account boundaries.
- Add stale-device retention or an explicit forget-device workflow.
Acceptance criteria
- Apple
Audio Languagedemonstrably affects initial playback selection and its portability matches the UI copy. - Android uses only server-supported keys and matches server defaults/ranges.
- Failed native writes survive process death and cannot cross profile/server/device boundaries.
- Device set and delete operations both target an explicit profile.
- Each semantic preference has a documented canonical scope and precedence.
- Profile settings reject invalid modes, unsupported quality values, and unreasonable language values.
- Web local appearance caches cannot carry from one account to another.
- Private-browser device rows have a retention/cleanup policy.
- Cross-repo contract tests fail when client keys/defaults/ranges drift from the server.
Verification performed
GOWORK=off go test ./internal/api/handlers ./internal/catalog ./internal/userstore/pgstorepassed.- Focused web settings, library-preference, and watch-route suites passed: 26/26 tests.
- Static call-path verification was completed across current Apple, Android, server, and web sources.
- No source files were modified during this audit.
Activity
Quick104 commentedon Jul 11, 2026
Design decision update (2026-07-10): the implementation will use a coordinated breaking settings-contract cutover, not the additive compatibility approach in the original implementation-order section. We will run a one-time verified migration, require an exact settings protocol version + manifest revision match across server/web/Apple/Android, remove the old string/open-ended preference surfaces, and block mismatched apps with an upgrade-required response.
The draft specification is at
docs/superpowers/specs/2026-07-10-cross-platform-user-settings-contract-design.md. Its ownership rule is server-first for every production user-facing setting (including contract-known client-local settings); only privatelocal.*implementation/diagnostic knobs may exist without a server contract PR and those values must never hit the API.Quick104 commentedon Jul 11, 2026
Draft design PR is open: #377
Please use the PR for line-by-line review of the canonical settings contract. It is spec-only and does not close this implementation issue. The PR supersedes this issue's original additive compatibility recommendation: the current proposal is a coordinated breaking cutover with a one-time verified migration and exact server/web/Apple/Android contract version + manifest revision matching.
docs(settings): address contract design review findings
docs(settings): stage the rollout and add the policy seam
docs(settings): return to a single coordinated switchover
docs(settings): drop release-ordering risk framing
feat(settings): give ui.theme a device override
docs(settings): define the cross-platform settings contract
feat(settings): add the canonical settings contract manifest
feat(settings): give ui.theme a device override
fix(web): tag local appearance caches with their owning account
feat(settings): add canonical typed storage for the settings contract
feat(settings): add the cross-platform settings contract and its mani…