Skip to content

fix(ios): read an unrecognized Safe Mode level from iCloud as Confirm Writes, not Off - #3214

Merged
datlechin merged 1 commit into
mainfrom
fix/sync-safe-mode-fails-closed
Sep 30, 2026
Merged

datlechin merged 1 commit into
mainfrom
fix/sync-safe-mode-fails-closed

Conversation

@datlechin

Copy link
Copy Markdown
Member

main is red: Package Tests fails SyncRecordMapperTests "An unrecognized wire value syncs as confirmWrites instead of off" (SyncRecordMapperTests.swift:87), which fails every PR merged against current main (seen on #3182 and #3186).

What was wrong

#3185 added SafeModeLevel(wireValue:isReadOnly:), which reads a level it does not recognize as Confirm Writes (fail closed), plus the test above. #3181, written in parallel, kept the package SyncRecordMapper's own private safeModeLevel(fromWire:isReadOnly:), whose fallback is Off. Both merged, so the iOS app still decodes a Safe Mode level synced from a newer Mac that it does not know as Off, and the test #3185 wrote for exactly that fails.

This also shipped in 0.76.1: the package mapper there had the same Off fallback.

What changed

SyncRecordMapper.storedSafeModeLevel(in:) calls SafeModeLevel(wireValue:isReadOnly:), and the private copy is gone, so the app mapper, the iOS mapper and both import services decode a wire value through one function.

Verification

  • swift test --filter TableProSyncTests in Packages/TableProCore: 144 passed, including the failing test.
  • SafeModeLevelTests: 8 passed.
  • SwiftLint on the changed file: 0 violations.

@datlechin
datlechin merged commit 4e5d62d into main Sep 30, 2026
12 checks passed
datlechin added a commit that referenced this pull request Oct 1, 2026
…ds:// into the etcd TLS Mode (#3186)

* fix(plugin-etcd): drop the SSL Mode the driver ignores and import etcds:// into the etcd TLS Mode

* fix(sync): decode unknown safe mode values with the model policy

* docs(changelog): drop the Safe Mode entry that #3214 already carries

---------

Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
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.

1 participant