From 6c340256793e1608be4d597408809012afcca5a5 Mon Sep 17 00:00:00 2001 From: Adron Hall Date: Thu, 17 Sep 2026 11:19:50 -0700 Subject: [PATCH] chore(api): explain the three unwired app-settings routes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #90 established that every APIClient function without a call site must say why it is kept, and #113's review sweep found three that don't: deleteAppSettings, appDeviceSettings and putAppDeviceSettings. All three are deliberate, not oversights — the per-device document is unwritten because iOS has no phone-specific persisted state worth syncing yet, and deleting the account document isn't an action any surface offers. Recording the reasoning so the next sweep doesn't re-litigate it, or delete routes that exist to give the first per-device setting an obvious home. No behaviour change; comments only. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_017bss5MgZa7Jvj2m9zdaUd1 --- InterlinedList/Services/APIClient+AppSettings.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/InterlinedList/Services/APIClient+AppSettings.swift b/InterlinedList/Services/APIClient+AppSettings.swift index b0c2564..69b1160 100644 --- a/InterlinedList/Services/APIClient+AppSettings.swift +++ b/InterlinedList/Services/APIClient+AppSettings.swift @@ -49,6 +49,11 @@ extension APIClient { } } + /// No caller. The account document is the sync service's own state, not something + /// a user asks the app to discard — the web's Applications section forgets a + /// *device*, which is `forgetAppDevice(deviceId:)`. Kept because the route is part + /// of the six-route contract this file covers and deleting it would leave the + /// surface half-modelled; wire it if a "stop syncing this account" control appears. func deleteAppSettings() async throws { try await delete(appSettingsBase) } @@ -111,6 +116,12 @@ extension APIClient { } // MARK: - Per-device document + // + // Neither of these has a caller, deliberately. iOS writes only the account-level + // document today, because it has no genuinely phone-specific persisted state worth + // syncing — see the account/device split recorded in #89. They exist so the first + // such setting has an obvious home instead of being appended to the shared + // document by default, which is the mistake that would be hard to undo later. func appDeviceSettings(deviceId: String, _ type: S.Type = S.self) async throws -> SettingsDoc? { do {