Repository navigation
fix(settings): drop the v1 string-setting fallback - #363
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code review summaryReviewed head: 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:
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 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 ( |
f3adc9f to
711abc6
Compare
fb4be1c to
1aa604a
Compare
711abc6 to
8d5ea7e
Compare
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]>
1aa604a to
2c66b7b
Compare
The app no longer calls the retired v1 string-settings routes. Card overlays read only the canonical
ui.card_overlayssetting, and the onboarding tour saves onlyprofile_fieldtargets.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:
OverlayPrefsStorefell back toGET /api/v1/settings/card_overlayswhengetEffectiveValuesthrewserverUpgradeRequired. Its write path (setPrefs,persist,resetToDefaults) could also sendPUTandDELETEfor that key, although nothing in the app or tests called it.OnboardingTourViewModelsentsettinganddevice_settingstep targets toPUT /api/v1/settings/{key}andPUT /api/v1/settings/device/{key}. The server only emitsprofile_fieldtargets (internal/onboarding/steps.go:34, 52).Solution
OverlayPrefsStorereads only the canonicalui.card_overlaysvalue. When the effective-values read reports that the server needs an update, the store setslastErrorto the existing server-update message ("This server needs to be updated before this version of Silo can use it."), renders the admin baseline fromoverlay-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.usesLegacyAPI,hasUserOverrideand thecard_overlayslegacy key are deleted.refreshGenerationstays (invariant I8), so a late answer for the previous profile is still dropped afterclear(). The store now takes aSiloAPI, which makes it testable; production still uses.shared.setting_choicesteps whose target is notprofile_fieldwhen 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.SiloAPI.setDeviceSetting,setSetting,deleteSetting,getUserSetting, theSettingEntryResponseandSetSettingBodymodels, and theOnboardingTourAPIrequirements for the two targets. Comments that described the legacy key are updated.This PR only removes writes. Onboarding
profile_fieldwrites and overlay reads behave as before, so it needs no failure-outcome table.Validation
SiloTests/OverlayPrefsStoreTests SiloTests/OnboardingInvitationTests SiloTests/HorizontalMediaRailTests SiloTests/SettingValuesAPITests) passed (91 tests, 0 failures) before the admin-baseline fix. After it,OverlayPrefsStoreTests,HorizontalMediaRailTestsandSettingValuesAPITestspassed on iOS (82 tests) and tvOS (78 tests) with 0 failures.OnboardingInvitationTestsis iOS-only.scripts/ci/check-no-api-v1.shpassed.OverlayPrefsStoreTestsonStubURLProtocol:overlay-configreturns 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.OnboardingInvitationTestsnow testsprofile_fieldwrites. New cases check that steps with retired targets are dropped at load and that choosing one writes nothing.Risks and follow-ups
/api/v1/settings/overlay-configand/api/v1/settings/values/effectiveat 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