Skip to content

feat: add per-connection local-only flag to exclude from iCloud sync#845

Merged
datlechin merged 7 commits intomainfrom
feat/local-only-connections
Apr 23, 2026
Merged

feat: add per-connection local-only flag to exclude from iCloud sync#845
datlechin merged 7 commits intomainfrom
feat/local-only-connections

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Add localOnly: Bool property to DatabaseConnection for per-connection iCloud sync exclusion
  • Skip SyncChangeTracker.markDirty/markDeleted for local-only connections (add, update, delete, duplicate)
  • Filter local-only connections from SyncCoordinator.performPush so they never reach CloudKit
  • Preserve local localOnly flag when merging remote connection updates in applyRemoteConnection
  • Add "Local only" toggle in connection form Advanced tab (visible only when sync is enabled)
  • Show icloud.slash indicator in connection sidebar for local-only connections
  • Add "Exclude from iCloud Sync" / "Include in iCloud Sync" context menu action (single + multi-select)
  • Include localOnly in connection export/import format
  • Backward compatible: existing connections default to localOnly = false

Closes #749

Test plan

  • Create connection, toggle "Local only" in Advanced tab, save — verify icloud.slash icon in sidebar
  • Right-click connection > "Exclude from iCloud Sync" — verify icon appears
  • Multi-select connections > right-click > bulk exclude — verify all get icons
  • Edit local-only connection — verify toggle is ON in Advanced tab
  • Duplicate local-only connection — verify copy is also local-only
  • With sync enabled: verify local-only connections don't appear in CloudKit push logs
  • Export connections, import on another device — verify localOnly flag preserved
  • Verify existing connections.json without localOnly loads correctly (defaults false)
  • Context menu items hidden when iCloud sync is disabled in settings

When a record is deleted locally, its tombstone is pushed to iCloud.
If the pull in the same sync cycle returns stale data for that record
(CloudKit eventual consistency), the record was re-added because
tombstones were not checked. Now all applyRemote methods (connection,
group, tag, SSH profile) skip records that have pending local tombstones.
…atch deletions

- ConnectionStorage: markDeleted before saveConnections (matches Group/Tag pattern)
- WelcomeViewModel: remove recentlyDeletedIds hack, debug logging; add rebuildTree after delete
- SyncCoordinator: remove pushedRecordNames echo hack, batch remote deletions (one load/save per type), auto-prune tombstones older than 30 days, only post connectionUpdated when actual changes applied, applyRemoteConnection returns Bool
@datlechin datlechin merged commit c7eb393 into main Apr 23, 2026
2 checks passed
@datlechin datlechin deleted the feat/local-only-connections branch April 23, 2026 12:12
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.

feat: Disable connections from beeing synced to iCloud

1 participant