Skip to content

fix(settings): drop the v1 string-setting fallback - #363

Merged
Quick104 merged 3 commits into
mainfrom
apiv2-stack/15-drop-string-setting-fallback
Sep 23, 2026
Merged

Quick104 merged 3 commits into
mainfrom
apiv2-stack/15-drop-string-setting-fallback

Conversation

@Quick104

Copy link
Copy Markdown
Contributor

The app no longer calls the retired v1 string-settings routes. Card overlays read only the canonical ui.card_overlays setting, and the onboarding tour saves only profile_field targets.

Closes #217

Problem

The server wants the v1 string-settings routes removed before the bridge release (#217). The app still reached them in two places:

  • OverlayPrefsStore fell back to GET /api/v1/settings/card_overlays when getEffectiveValues threw serverUpgradeRequired. Its write path (setPrefs, persist, resetToDefaults) could also send PUT and DELETE for that key, although nothing in the app or tests called it.
  • OnboardingTourViewModel sent setting and device_setting step targets to PUT /api/v1/settings/{key} and PUT /api/v1/settings/device/{key}. The server only emits profile_field targets (internal/onboarding/steps.go:34, 52).

Solution

  • OverlayPrefsStore reads only the canonical ui.card_overlays value. When the effective-values read reports that the server needs an update, the store sets lastError to the existing server-update message ("This server needs to be updated before this version of Silo can use it."), renders the admin baseline from overlay-config (or the registry defaults when there is none), and stays unhydrated, so it retries on the next hydrate. Two cases trigger this: the server lacks the canonical settings API (a route 404), or its settings revision is behind the app's contract revision. Transient read failures still keep the prior prefs. There is no fallback route.
  • The unused overlay write path, usesLegacyAPI, hasUserOverride and the card_overlays legacy key are deleted. refreshGeneration stays (invariant I8), so a late answer for the previous profile is still dropped after clear(). The store now takes a SiloAPI, which makes it testable; production still uses .shared.
  • Per decision D6, the onboarding tour drops setting_choice steps whose target is not profile_field when it loads, the same way it drops unknown step kinds. Android still renders these steps and skips the write when the user advances, so neither client writes anything for them. Choosing such a step directly writes nothing and shows the existing "cannot save" error.
  • Deleted SiloAPI.setDeviceSetting, setSetting, deleteSetting, getUserSetting, the SettingEntryResponse and SetSettingBody models, and the OnboardingTourAPI requirements for the two targets. Comments that described the legacy key are updated.

This PR only removes writes. Onboarding profile_field writes and overlay reads behave as before, so it needs no failure-outcome table.

Validation

  • iOS, tvOS and macOS builds passed on the final branch.
  • iOS tests (SiloTests/OverlayPrefsStoreTests SiloTests/OnboardingInvitationTests SiloTests/HorizontalMediaRailTests SiloTests/SettingValuesAPITests) passed (91 tests, 0 failures) before the admin-baseline fix. After it, OverlayPrefsStoreTests, HorizontalMediaRailTests and SettingValuesAPITests passed on iOS (82 tests) and tvOS (78 tests) with 0 failures. OnboardingInvitationTests is iOS-only.
  • scripts/ci/check-no-api-v1.sh passed.
  • New OverlayPrefsStoreTests on StubURLProtocol:
    • A router 404 on the effective-values route sets the update-required message, leaves the defaults in place, keeps the store unhydrated, and sends no other request.
    • When overlay-config returns an admin baseline and effective values answers with a route 404 or a revision behind the contract, the store renders that baseline, reports the update-required message, and stays unhydrated.
    • A profile switch while profile A's read is stalled applies profile B's answer and drops profile A's late answer.
    • A saved profile document wins over the admin baseline, and the admin kill switch still applies.
  • OnboardingInvitationTests now tests profile_field writes. New cases check that steps with retired targets are dropped at load and that choosing one writes nothing.
  • The completed stack passed the full iOS suite (1981 tests) and tvOS suite (1792 tests) with 0 failures, built for macOS and passed the v1 path guard. Every branch in the stack builds on its own.
  • Not run: the plan's manual iOS/tvOS pass (change overlays, relaunch, switch profile). The app has no overlay editor, so only relaunch and profile switch apply.

Risks and follow-ups

  • On a server that predates the canonical settings API, users who saved overlay prefs through the legacy key now see the admin baseline or the default layout. Such a server already needs an update for the rest of v2.
  • A v2 server whose settings revision is behind the app's contract (revision 5 at this PR, 8 after W4-K) also takes the update-required path: saved overlay prefs are ignored, and the store refetches on every hydrate until the server is updated.
  • The overlay store still reads /api/v1/settings/overlay-config and /api/v1/settings/values/effective at this point in the stack. W4-A and W4-D move those reads to v2. The new tests match on path suffixes, so they carry over unchanged.

AI disclosure

Code and description written by Claude Opus 5.5 (claude-opus-5-5) agents in Claude Code (T3 Code), orchestrated by a Claude Code workflow.


Part 15 of 50 in the Apple API v2 stack. Base: apiv2-stack/14-siloremote-handoffs-v2. Merge in order from the bottom of the stack. The plan and full index are in PR 01.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1b1d1f1a-afcc-4177-8edb-898e5e7266d8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T13:38:48.627778Z 2c66b7b New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Quick104

Copy link
Copy Markdown
Contributor Author

Code review summary

Reviewed head: fb4be1c5 (apiv2-stack/15-drop-string-setting-fallback).

Process: an adversarial review of this PR's diff with each candidate finding independently verified before any fix, a simplify pass for medium and larger PRs, and a whole-stack review across contract conformance, authority and failure handling, data integrity, user-visible behavior and cross-PR integration.

Verified findings, all fixed on this branch:

  • minor: An update-required read now drops the admin overlay baseline, even when overlay-config succeeded
  • minor: PR body says dropping retired-target steps at load matches Android, but Android renders them

Validation: this branch builds on its own for iOS, tvOS and macOS, and its focused tests passed. The completed stack passed the full iOS suite (1981 tests) and tvOS suite (1792 tests) with 0 failures, the macOS build and the v1 path guard. The final stack was also exercised on iOS and tvOS simulators against a v1/v2 bridge server: sign-in (password and QR), restore, browse, search, detail, favorites and watchlist, playback (direct play, transcode, subtitles, stop), audiobooks, downloads with offline playback, settings, requests, profiles, push registration and diagnostics. Server logs showed no /api/v1 request from the new builds except the retained health probe.

Remaining: no open verified findings. Merge in stack order.

Mergeability: 8/10 — conditional. The approach holds up and every verified finding is fixed. Conditions: this PR's CI must pass (it was pending at review time), and the owner still plans a physical-device check of the completed stack.

Review by Claude Opus 5.5 (claude-opus-5-5) agents in Claude Code (T3 Code).

@Quick104
Quick104 force-pushed the apiv2-stack/14-siloremote-handoffs-v2 branch from f3adc9f to 711abc6 Compare September 23, 2026 13:19
@Quick104
Quick104 force-pushed the apiv2-stack/15-drop-string-setting-fallback branch from fb4be1c to 1aa604a Compare September 23, 2026 13:19
@Quick104
Quick104 force-pushed the apiv2-stack/14-siloremote-handoffs-v2 branch from 711abc6 to 8d5ea7e Compare September 23, 2026 13:33
Base automatically changed from apiv2-stack/14-siloremote-handoffs-v2 to main September 23, 2026 13:35
Quick104 and others added 3 commits September 23, 2026 09:35
The app still reached the retired v1 string-settings routes in two places.
OverlayPrefsStore fell back to GET /api/v1/settings/card_overlays when a
server lacked the canonical settings API, and its unused write path could
PUT or DELETE that key. The onboarding tour wrote `setting` and
`device_setting` step targets through PUT /api/v1/settings/{key} and
/api/v1/settings/device/{key}, although the server only emits
`profile_field` targets. The server wants these routes gone before the
bridge release (silo-apple#217).

OverlayPrefsStore now reads only the canonical `ui.card_overlays` value.
A server without that API reports the existing server-update message and
renders the defaults. The write path had no callers and is deleted with
its legacy branches; refreshGeneration stays, so a profile switch during a
read still drops the old profile's answer. The onboarding tour drops steps
with any target other than `profile_field` at load, and choosing one
writes nothing. SiloAPI loses setDeviceSetting, setSetting, deleteSetting
and getUserSetting with their SettingEntryResponse and SetSettingBody
models.

Stack-PR: W1-C
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Stack-PR: W1-C
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…s an update

When the effective-values read reported that the server needs an update
(a route 404, or a settings revision behind the app's contract), the
overlay store kept the registry defaults and ignored the admin baseline
that overlay-config had just returned.

The update-required path now renders the admin baseline (or the registry
defaults without one) while still reporting the server-update message and
leaving the store unhydrated. Transient read failures still keep the
prior prefs.

Stack-PR: W1-C
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Quick104
Quick104 force-pushed the apiv2-stack/15-drop-string-setting-fallback branch from 1aa604a to 2c66b7b Compare September 23, 2026 13:36
@Quick104
Quick104 merged commit c1e6ee7 into main Sep 23, 2026
3 of 6 checks passed
@Quick104
Quick104 deleted the apiv2-stack/15-drop-string-setting-fallback branch September 23, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retire v1 call sites with no server counterpart: /user/me, transcode/start, string settings routes

1 participant