summaryrefslogtreecommitdiff
path: root/DomainDig/CloudSyncService.swift
Commit message (Collapse)AuthorAgeFilesLines
* fix: sync CloudKit through a custom zone instead of queries (#29)Christian Cleberg11 days1-109/+131
| | | | | | | | | | | | | | | | | | | | | | | | | With the entitlement gate removed, enabling iCloud sync surfaced a chain of CloudKit errors, each rooted in the query-based fetch: - "Did not find record type: TrackedDomain" — a fresh container has no schema until the first save, so querying any type failed. - "SharedDB does not support Zone Wide queries" — the shared database rejects database-wide queries. - "field 'recordName' is not marked queryable" — TRUEPREDICATE queries require a Queryable index on recordName, which auto-created development schemas do not have. All three are inherent to reading with CKQuery. Move the user's own records into a single custom record zone and read every record with CKFetchRecordZoneChangesOperation, which needs no queryable indexes and works on a brand-new zone. The shared database is read the same way, one zone per accepted share. A custom zone is also a prerequisite for CloudKit sharing, so share root records now live there too. - Ensure the custom zone exists before every push and fetch (idempotent). - Save all records — and build tombstone delete IDs — in the custom zone. - Replace the per-type CKQuery fetch with a per-zone change fetch that drains truncated responses via the server change token.
* fix: reach CloudKit instead of gating on unreliable entitlement ↵Christian Cleberg11 days1-40/+13
| | | | | | | | | | | | | | | | | | | | introspection (#29) iCloud sync always failed with "This build does not have the CloudKit entitlement required for iCloud sync." on normal Debug/device builds. `cloudKitContainer()` gated construction on `isEntitlementConfigurationAvailable()`, which inspected `Info.plist` keys and an `archived-expanded-entitlements.xcent` file. Entitlements live in the code signature, not `Info.plist`, and the `.xcent` file only exists in archived/distribution builds — so the check returned false for a correctly-signed development build, the container was never created, and every path reported `.missingEntitlement`. Stop introspecting entitlements. Always construct `CKContainer.default()` and let CloudKit's own `accountStatus()` drive availability. When the entitlement is genuinely absent, CloudKit surfaces `.missingEntitlement` / `.badContainer` / `.permissionFailure`, which `accountStatus()` now maps back to the "no entitlement" message — preserving that signal without the false negative.
* v4.8.3: Clear SonarCloud new-code issuesChristian Cleberg2026-07-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the 4 reported bugs and ~97 code smells flagged in the new-code period. No behavior changes. Bugs (swift:S3923) — DomainInspectionService's confidenceFor* helpers each returned `error == nil ? .low : .low`, an inert conditional. Simplified to `return .low` and dropped the now-unused `error` parameter. Smells: - Merged 14 identical `.empty`/`.error` switch branches in DomainViewModel - Consolidated duplicate implementations (clearPresentedResults/reset, String.nonEmpty/nilIfEmpty, ExportFormat.id/fileExtension) - Extracted nested ternaries into TLSGrade.tone, EmailSecurityGrade.tone, and ChangeImpactClassification.color; removed ContentView.impactColor and the duplicate mapping in BatchResultsView - Documented empty closures and singleton inits - Marked unused protocol-conformance parameters `_` - Renamed CloudSyncTrigger.`import` to `imported` (raw value preserved) and SSLSessionDelegate's _serverTrust/_tlsMetadata - Merged nested ifs in the DER parser; flattened closure nesting in PortScanService and IntegrationService - Replaced two-case switches with if/else Left open: S107 (init parameter counts), S115 (constants mirroring DoH and ipapi JSON keys), S1075 (false positives on https:// literals), and two S117 hits on SwiftUI $binding shorthand. These want a Won't Fix resolution in SonarCloud, not a code change.
* DomainDig v4.1.0: Add a full local data reset flow in Data ManagementChristian Cleberg2026-04-251-0/+14
| | | | | | | | | | | | | | | | | | | | - add a destructive Delete All Data action with confirmation, progress, success, and failure handling - centralize wipe behavior in DataResetService instead of scattering delete logic in views - clear local persistence, temp/export files, integration secrets, notifications, caches, and in-memory app state - reset sync, purchase, and integration services after wipe so the app returns to a clean first-launch state Polish batch and empty-state UX - present the batch sweep summary after manual bulk searches complete, not only from Watchlist - align the Workflows empty state styling with other empty states by removing the extra background card treatment Bump the project version from 4.0.0 to 4.1.0
* DomainDig v3.8.0 — Smart MonitoringChristian Cleberg2026-04-241-0/+22
| | | | | | | | | * Stable domain intervals * Frequent changes decrease intervals * Duplicate states do not trigger alerts * Quiet hours suppress alerts * Quiet hours across midnight work correctly * Sensitivity levels alter behavior as expected
* feat(v3.6.0): add iCloud sharing for workflows and tracked domainsChristian Cleberg2026-04-231-0/+1588
- implement CloudKit sharing (CKShare) for TrackedDomain and DomainWorkflow - support read-only and editable permissions - add Share actions and shared state indicators in UI - handle shared record ownership and participant roles - implement deterministic conflict resolution to prevent duplication - ensure compatibility with existing iCloud sync layer - maintain local-first behavior with graceful offline handling - remove debug logging for domain availability/rdap messages notes: - no custom backend or accounts introduced - sharing is Apple ecosystem only (iCloud-based) - large history data remains local-only