Repository navigation
harden(app): own capture connect/reconnect and the session generation - #14394
Git-on-my-level wants to merge 13 commits into
Conversation
Keep-alive during an in-flight connect now joins one socket attempt, and work started under generation N cannot publish after N+1. The explicit conversation-open path forwards session geolocation the way production already does, without changing default CaptureProvider() wiring. Co-authored-by: Cursor <[email protected]>
Architect conformance review: conforms, with required changesReviewed at What is credited: the 13 owner/provider tests pass; real-provider geolocation reaches the Three required changes:
Twelve new oracle cases across this review reproduce the defects; the existing protected tests The pattern across all three is one boundary: this PR correctly fences work at admission, and 🤖 Generated with Claude Code |
Admission already captured generation; publication after every await now keeps that original operation generation. Stop invalidates in-flight work before WAL teardown, and a skipped persist cannot occupy the fingerprint. Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Three required changes addressed —
|
…ket-generation Co-authored-by: Cursor <[email protected]> # Conflicts: # app/test/spine/c1_persistence_fingerprint_test.dart # app/test/spine/c1_socket_drain_test.dart # app/test/spine/c1_stop_generation_test.dart
The merge commit's dart format rewrapped c1_lifetime_review_test.dart. Spine originals may only drop pending markers, so restore the lifetime bytes. Co-authored-by: Cursor <[email protected]>
pre-commit dart format rewrapped this protected original. Restore the lifetime bytes; spine allows pending-marker removal only. Co-authored-by: Cursor <[email protected]>
composeCaptureProvider is the seam; the provider import is leftover. Co-authored-by: Cursor <[email protected]>
…canonical These entered at this commit's parent merge. The merge resolution needed OMI_SKIP_DART_FORMAT=1 so the pre-commit hook could not rewrite a digest-pinned spine oracle (c1_lifetime_review_test.dart) — but that skip is all-or-nothing, so it also left analytics_manager.dart and omi_double_tap_goldens_test.dart unformatted, and they rode up the rest of the C1 chain. Formatter only, no semantic change. origin/main formats both paths with 0 changed, so this is the merge-collateral class, not new content. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Hey @Git-on-my-level 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
|
Auto-closed when base branch was deleted after its parent squash-merged. Head unchanged at |
What changed and why
C1 step 4: one owner for the conversation socket's connect and reconnect, and the capture
session generation applied across every await the contract names. This is the step the fix
history argues for most directly — async-lifecycle is the largest defect origin at 20% of 514
mobile fixes, and its two biggest reopened clusters are work that survives a session or
identity roll (18 rows) and keep-alive overlapping an in-flight connect.
Connect and reconnect have one owner.
CaptureSessionOwner.connectjoins callers thatshare a generation and configuration, so a keep-alive tick arriving during an in-flight open no
longer opens a second socket, and two concurrent reconnect requests coalesce. A changed
configuration closes the late socket exactly once rather than leaking it. The tests assert the
behavior, not call-site counts, and the coalescing ones run against the real provider.
The session generation uses the idiom the providers already had rather than a new one:
CaptureSessionOwner.token/isCurrent/replaceSession, which is the existing_sessionGenerationconcept named. Codec fetch, keep-alive, location upload, a queuedreplaceSession, and the coordinator wake each capture the token before their await and refuseto write state after generation N+1.
Geolocation is preserved on the explicit path. The architect's conformance review flagged
that its own socket seam omitted the geolocation the real production call includes.
openConversationSocketnow passes_sessionGeolocationthe way productionsocket.conversationalready does, and the test asserts it against the real provider ratherthan with a source-string check — the review was explicit that the forwarding assertions are
static tripwires and not behavioral coverage.
Two things deliberately not done. No file was extracted out of
capture_controller.dart: theowner already lived in
capture_session_owner.dart, so that is where this landed, which avoidschurning the hottest file in the app for no behavioral gain. And the default
CaptureProvider()wiring is unchanged — keeping the defaults while the explicit path grows is the agreed sequence,
and the atomic cutover across roughly 90 construction sites is a later cut.
Product invariants affected
none
How it was verified
TZ=UTC bash app/test.sh→ 2114 passed.python3 scripts/check_spine_contracts.pypasses with39 pending markers remaining — foreground-service ownership, the recovery wake, and the
keep-alive timer are explicitly later cuts and are not claimed here.
make mobile-verify ARGS="fast --paths …"→ 20 of 20 journeys executed and passed, whichmatters because this is capture code and the journeys are the only thing that exercises it end
to end.
make preflightfailed once insidetest_two_sessions_get_disjoint_ports_and_instancesandpassed on retry. That is a pre-existing allocation defect on
main, not this branch: twodistinct session offsets derive the same TCP port. It is fixed separately by the harness lane's
port-claim PR.
No simulator, device, or production host was involved.
Tests
capture_session_owner_test.dart(keep-alive joining a pending connect) andcapture_socket_generation_test.dart(concurrent reconnect coalescing, keep-alive during anin-flight connect, ABA codec fetch, location upload, persistence, auth refresh, coordinator
wake, and the real-provider geolocation assertion), plus the matching C1 spine contracts whose
pending markers are retired by this implementation.
Failure class (fixes)
Failure-Class: none
🤖 Generated with Claude Code