Skip to content

fix(connections): apply remote deletions only for the iCloud sync categories that are on - #3179

Merged
datlechin merged 2 commits into
mainfrom
fix/sync-remote-deletions-category-toggles
Sep 29, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/sync-remote-deletions-category-toggles

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Remote deletions of connections, groups, tags, SSH profiles and table favorites were applied on this Mac even with that iCloud sync category switched off, which deleted the connection's saved queries and query history, or the SSH profile's Keychain secrets. Root cause: the deletion parser kept its own hand-written copy of the category map that only checked credential profiles and saved queries, while changed records were gated per category in the pull loop. Both now read one exhaustive SyncSettings.syncs(_:) predicate over SyncRecordType, so a new record type does not compile until it is mapped to a switch.

Tests

  • SyncPendingDeletionsTests (new): connectionDeletionFollowsItsSwitch, groupDeletionFollowsItsSwitch, tagDeletionFollowsItsSwitch, sshProfileDeletionFollowsItsSwitch, tableFavoriteDeletionFollowsItsSwitch, switchedOffCategoryLeavesOthersApplied and everyCategoryOffAppliesNothing fail without the fix (7 of the first 9 cases). credentialProfileDeletionFollowsItsSwitch and sqlFavoriteDeletionFollowsItsSwitch pass before and after, guarding the two categories that were already gated. eachSwitchWithholdsItsOwnRecordTypes pins every record type to its own switch and fails when a type is mapped to the wrong one.
  • SyncCoordinatorEchoTests.remoteDeletionsWithheldWhileCategoryOff (new): a tag and a group deleted elsewhere while Groups and Tags is off stay on this Mac, through a real SyncCoordinator.applyPullResult. Fails without the fix.
  • SyncCoordinatorEchoTests.remoteChangeWithheldWhileCategoryOff (new): a remote tag change is not applied while Groups and Tags is off. Passes before and after; it guards the refactored changed-record loop.

Docs

The docs rewrite branch covers the user-facing text for what a switched-off sync category does with deletions.

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