Skip to content

refactor(WhereCore): Observe remote changes with HistoryObserver - #319

Open
kyleve wants to merge 1 commit into
mainfrom
codex/ios-27-history-observer
Open

kyleve wants to merge 1 commit into
mainfrom
codex/ios-27-history-observer

Conversation

@kyleve

@kyleve kyleve commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace WhereCore's Core Data remote-change notification bridge with SwiftData's HistoryObserver.
  • Keep the existing external-only changes() and remoteChanges() streams, author classification, event coalescing, startup catch-up, and logged failure behavior.
  • Exercise the production source with temporary on-disk stores and update the module contracts and backlog.

Design decisions

HistoryObserver is scoped to Where's ModelContainer, so an unrelated Periscope store cannot trigger a Where refresh. Its authors parameter only includes named authors; it cannot exclude the current store instance's author while accepting arbitrary CloudKit and sibling-process authors. The history classifier therefore remains responsible for suppressing local writes.

The source observes eventCounter through Observations. It compares the first emitted value with the counter captured during setup, then checks history once after registration to cover a transaction committed between the baseline and observation startup.

Review focus

  • External commits through a second container must refresh Where without a manually posted notification.
  • Local saves must not trigger a second full reconciliation. A separate store must not trigger one either.
  • The test suite does not perform a live multi-device CloudKit import; that Apple delivery contract remains outside the off-device tests.

Testing

  • ./ide --no-open and ./swiftformat --lint — passed.
  • Focused StoreRemoteChangeSourceTests — 6 tests passed.
  • BUMPER_EVALUATION_TIMEOUT_SECONDS=300 ./test --architecture-only — passed.
  • ./test --everything --skip-architecture — 2,029 iOS unit tests and 50 snapshot suites passed.
  • mise exec -- tuist test Ledger-macOS-Tests --no-selective-testing -- -destination 'platform=macOS' — passed.

Stack

Second PR, based on PR #318. The iOS 27 minimum in that PR makes HistoryObserver available to WhereCore.

@kyleve
kyleve added this pull request to stack #320 September 17, 2026 19:43
@kyleve kyleve changed the title Observe remote SwiftData history on iOS 27 refactor(WhereCore): Observe remote changes with HistoryObserver Sep 17, 2026
Base automatically changed from codex/ios-27-minimum to main September 17, 2026 21:55
kyleve added a commit that referenced this pull request Sep 17, 2026
## Summary

- Require iOS 27.0 across the iOS apps, extensions, package products,
and test bundles. The macOS minimum stays at 26.0.
- Remove the iOS 26.1 tab-accessory availability branch and inline the
accessory in `MainTabs`.
- Update requirements and snapshot guidance. Native-glass settle floors
remain because the iOS 27 snapshot suite still depends on them.

## Why

The supported iOS runtime is now 27.0. The old deployment minimum kept
an unreachable iOS 26.0 presentation path and prevented the follow-on
SwiftData HistoryObserver migration.

## Compatibility

Devices on iOS 26 cannot install this app version. Persistence, CloudKit
schema, and backup formats do not change. `Package.swift` uses
`.iOS("27.0")` because the manifest's Swift tools version 6.2 does not
provide the `.v27` shorthand.

## Review focus

- The native tab accessory renders through the same existing status view
on iOS 27.
- Snapshot settling and the iOS 27 tile-and-stitch workaround remain in
place.

## Testing

- `./ide --no-open` — passed.
- `./swiftformat --lint` — passed.
- `BUMPER_EVALUATION_TIMEOUT_SECONDS=300 ./test --architecture-only` —
passed; the default 60-second budget timed out on the initial run.
- `./test --everything --skip-architecture` — 2,023 iOS unit tests and
50 snapshot suites passed.
- `mise exec -- tuist test Ledger-macOS-Tests --no-selective-testing --
-destination 'platform=macOS'` — passed.

## Stack

Base PR. [PR #319](#319) migrates
WhereCore to HistoryObserver on top of this minimum-version change.
Replace the Core Data remote-change notification bridge with a SwiftData HistoryObserver while preserving the external-author classifier, startup catch-up, coalescing, and store change streams. Exercise the production source with temporary on-disk containers and update its module contracts.
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