Skip to content

fix(desktop): revert Settings toggles to the confirmed value on a failed save (#22780) - #22798

Merged
kodjima33 merged 1 commit into
mainfrom
watchdog/issue-22780-settings-toggle-revert
Oct 20, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
watchdog/issue-22780-settings-toggle-revert

Conversation

@kodjima33

@kodjima33 kodjima33 commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Daily Summary, Store Recordings, and Private Cloud Sync switches in macOS Settings
bind directly to the value shown on screen. A failed save (offline, server error,
expired session) was only logged: the switch stayed on the side the user picked
while the account kept its old value, and the next Settings load quietly flipped
it back with no message. For Store Recordings/Private Cloud Sync this means a user
can believe they changed a privacy-relevant setting when the account never stored
it. Fixes #22780.

#22403 fixed the identical symptom for Custom Vocabulary by tracking the value the
account last confirmed and restoring it on failure. This extracts that pattern into
a small, directly testable BooleanSettingSaver (mirrors TranscriptionVocabularySaver)
and applies it to the three toggles, surfacing a short inline error on failure.

Product invariants affected

INV-BETA-1 — SettingsContentView+Controls.swift is on this invariant's path glob
because it also hosts beta-identity UI. This change only adds an optional
errorText: String? = nil parameter to privacyToggleRow (used solely by the two
privacy toggles); it does not touch beta-identity gating, storage, or Sparkle
channel code. AppBuildBetaIdentityTests (8 tests) still pass unmodified.

How it was verified

  • xcrun swift build -c debug --package-path Desktop — succeeds.
  • xcrun swift test -c debug --package-path Desktop --filter "BooleanSettingSaverTests|TranscriptionVocabularySaverTests|AppBuildBetaIdentityTests" — all 17 tests pass.
  • ./scripts/swift-format-wrapper.sh lint <changed files> — clean.
  • python3 scripts/check_desktop_test_quality.py — at or below baseline.
  • Not run: a live named-bundle GUI smoke of the three toggles (autonomous hourly
    pass). The behavioral test exercises the exact save/restore code path
    (BooleanSettingSaver.save) through a fake account that can refuse a write,
    which is the mechanism the bug report and the fix are both about.

Tests

Added Desktop/Tests/BooleanSettingSaverTests.swift: a failed save restores the
account's last-confirmed value, a failed save before Settings has read the account
reports no value to restore, and a successful save records the stored value.
Mirrors the existing TranscriptionVocabularySaverTests for the list case.

UI evidence

UI-Evidence: none -- autonomous hourly pass; verified via the extracted save/restore
unit under BooleanSettingSaverTests, not a GUI screenshot. The change is additive
(an optional inline error line) and the existing toggle layout is unchanged.

Failure class (fixes)

Failure-Class: none

🤖 automated by hourly watchdog — tested and merged

View guided diff Turn on auto-fix

…led save (#22780)

Daily Summary, Store Recordings, and Private Cloud Sync bind their switch
directly to the value shown on screen. A failed save (offline, server error,
expired session) was only logged: the switch stayed on the side the user
picked while the account kept its old value, and the next Settings load
quietly flipped it back with no message — for Store Recordings/Private Cloud
Sync this means a user believes they changed a privacy-relevant setting when
the account never stored the change.

#22403 fixed the same symptom for Custom Vocabulary by tracking the value
the account last confirmed and restoring it on failure. This extracts that
pattern into a small, directly testable BooleanSettingSaver and applies it
to the three toggles.

Tested: added BooleanSettingSaverTests (new file) exercising save/restore
through the production save function with a fake account that can refuse
a write; xcrun swift build succeeds; swift-format lint clean.
@kodjima33
kodjima33 merged commit f804c0a into main Oct 20, 2026
49 checks passed
@kodjima33
kodjima33 deleted the watchdog/issue-22780-settings-toggle-revert branch October 20, 2026 09:53
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.

macOS Settings switches stay flipped when the account refuses the save

1 participant