Skip to content

Unify roaming and device-scoped user settings across web, Apple, and Android #376

Open

Description

@Quick104

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-server 3fd0912cb3fe15cc364f3dd04095c2e39db0bef0
  • silo-apple 120f493593119e71dfb1247dde0f89c55d46c1d0
  • silo-android 5c6439cebe753103c3a12cca7d1d152c5d6e35ab

Expected portability model

The product should have one documented precedence model:

  1. Profile-wide defaults roam to every client and new browser session.
  2. Optional library defaults override the profile for one library.
  3. Explicit series/item track choices override both.
  4. Device overrides apply only to one profile on one stable device/browser identity.
  5. 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-62 exposes the picker.
  • silo-apple/iosApp/iosApp/Screens/Settings/SettingsViewModel.swift:123-126 forwards it to PlayerSettings.setAudioLanguage.
  • silo-apple/iosApp/iosApp/Screens/Player/PlayerSettings.swift:372-375 writes playback.audio_language as a device setting.
  • Repository-wide Apple usage shows PlayerSettings.audioLanguage is 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.Language in internal/catalog/detail.go:2869-2907 and internal/api/handlers/playback.go:1398-1428.
  • Apple decodes the full profile language, but iosApp/iosApp/Networking/WireFormatModels.swift:36-49 deliberately drops it when converting to UserProfile; UpdateProfileBody also 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_seconds in shared/.../PlaybackSettingsKeys.kt:16; server and Apple use playback.next_up_prompt_seconds.
  • Android clamps playback speed to 4.0 in AndroidPlayerSettingsStore.kt:280-285, and its unit test explicitly expects 4.0; the server rejects values above 3.0 in internal/api/handlers/settings.go:249-252.
  • Android includes unregistered keys such as player.match_frame_rate, player.sleep_timer_default_minutes, and individual subtitle.* fields in PlaybackSettingsKeys.DeviceSettings. The server only accepts registered device-scope keys (keyUsesDeviceScope in settings.go:742-745), so writes/deletes for unknown keys return a bad request.
  • Android defaults Profile 7 HDR10 fallback to true before hydration (AndroidPlayerSettingsStore.kt:143-145); server and Apple default it to false.

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-82 removes pending operations before sending them.
  • ServerSettingsFlusher.kt:87-102 only logs API/network errors and never requeues them.
  • Set operations pass the queued profileId, but delete operations call deleteDeviceSetting(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.pendingDeviceSettingValues is 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 before refreshFromServer() 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

  • HandleUpdateProfile decodes and persists quality_preference, language, subtitle_language, and subtitle_mode without 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_devices rows 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, or Local to this app;
  • expose Use profile default for settings that support an optional device override;
  • show Saved, Sync pending, and Couldn't sync instead of treating queued native writes as complete;
  • explain that private windows are new devices and therefore use profile defaults.

Recommended implementation order

  1. Fix Apple audio-language behavior and Android key/default/range mismatches.
  2. Make native pending operations durable and scope them by server + profile + device; pass explicit profile IDs on both set and delete.
  3. Publish one additive server-owned settings schema/capability contract containing key, scope, default, allowed values/ranges, and portability description.
  4. Decide and migrate the duplicate profile/device semantics, preserving /api/v1 compatibility. Recommended spoken language model: roaming profile default with an optional explicit device override.
  5. Validate profile preference payloads using the same canonical definitions.
  6. Owner-tag or clear all web local warm caches on account boundaries.
  7. Add stale-device retention or an explicit forget-device workflow.

Acceptance criteria

  • Apple Audio Language demonstrably 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/pgstore passed.
  • 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

  1. added
    bug
    enhancement
    on Jul 11, 2026
  2. Quick104 commented on Jul 11, 2026

    @Quick104
    ContributorAuthor

    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 private local.* implementation/diagnostic knobs may exist without a server contract PR and those values must never hit the API.

  3. Quick104 commented on Jul 11, 2026

    @Quick104
    ContributorAuthor

    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.

  4. added
    triaged
    and removed
    triaged
    on Sep 20, 2026
  5. added theissue type on Sep 20, 2026
  6. removed
    bug
    on Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions