Skip to content

fix(account): an accepted It's me also closes the original admission for devices that were offline (S2P-11) - #4383

Merged
devswha merged 2 commits into
mainfrom
fix/s2p-11-its-me-close
Nov 20, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/s2p-11-its-me-close

Conversation

@devswha

@devswha devswha commented Nov 20, 2026

Copy link
Copy Markdown
Owner

It's me: an accepted It's me also closes the original admission for devices that were offline (S2P-11)

Behind OVIS_ACCOUNT_OPENS_ALL. The ledgered leftover of #4370's final round (no HIGH there), plus two of dori's LOWs on #4370. No access, wire-schema or copy change.

Device table rows: OD3, T53, T57; ledger S2P-11.

What changes (server/account/device-journal.ts, the app's notice feed)

  • S2P-11: an accepted It's me now writes the T53 confirmation and the original admission's same-id open: false close in one journal replacement. A device that acknowledged the admission and was offline gets that id closed on reconnect. The app folds the close into its matching confirmation, so the admission card never reappears.
  • dori LOW (decide on a broken journal): when the journal is already strict, decide() throws without overwriting the stored cause; only a real write failure records a new message.
  • dori LOW (journal cap): JOURNAL_MAX now says that close entries count toward the cap (unchanged).
  • dori's third LOW was fix(app): It's me resends only for the same sign-in, and a notice closed offline is replayed as closed (S2P-9, S2P-10) #4370's PR body (the validation line named an older head); this body names its own head.

Tests (red first)

  • d08c2d3 (3 fail there): the It's me route replay had only the confirmation, not the original id with open: false; a strict journal's second decide() wrapped the original EISDIR cause in another message; the client feed still held the closed admission's id after replay.
  • df98318: the fix.

New exports

None.

Reviews

dori review + omo gate reviewer via relay-hub (t13t); security-triage (t13r) on the journal change.

Validation

bun run check fast on df98318 via dori heavy (hosthatch): unit 21516 pass / 0 fail, typecheck, build, generated files, actionlint. bun test ./server/account: 934 pass, 1 skip (needs Linux root); src/components/AccountDeviceNotices.test.tsx, src/App.deviceNotices.test.tsx, src/lib/useDeviceNotices.test.tsx, server/conventions.test.ts: 72 pass; typecheck 0.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Corrected how replayed “It’s me” confirmations are matched with admission notices, including when the admission has already been closed.
    • Preserved the correct ordering of confirmations and admission notices during replay, helping device notice history reflect the latest status.
    • Improved handling of notice updates when a decision cannot be saved, keeping the admission open and subsequent decisions consistent.

The journal now records replay sequences for closed notices, including confirmations. Strict mode is checked before notice presence. Device notice matching handles closed admissions, with tests covering write failures, offline replay, and card filtering.

Changes: Admission replay

Layer / File(s) Summary
Journal close recording and strict mode
server/account/device-journal.ts, server/account/device-journal.test.ts
Journal writes assign replay sequences to every removed open notice, including confirmations. decide checks strict mode before checking whether the notice is open. The test covers repeated calls after a write failure. The journal cap comment now includes replay-only closes.
Offline observer replay
server/account/its-me-route.contract.test.ts
The contract test checks that an observer reconnects to a closed confirmation followed by the closed admission. It also checks the sequence ordering and that replay matches the journal state.
Closed admission matching
src/lib/deviceNotices.ts, src/lib/useDeviceNotices.test.tsx
confirmsAdmission accepts closed admissions with the corresponding sequence ordering. The test checks that replay does not restore the original admission card.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

  • devswha/ovis#4307: Introduces the device journal, numbered entries, and notice replay used by this change.
  • devswha/ovis#4370: Covers replaying a notice closed while a device was offline; this change applies closed-notice replay to the accepted “It’s me” path.
Merge Risk: Minimal · up to df983

An accepted "It's me" now also closes the original admission for devices that were offline, so the admission card no longer reappears after they reconnect. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: an accepted It's me also closes the original admission for offline devices (S2P-11). The raw summary covers the journal write, the confirmsAdmission matching change, t…
Description check Passed The description follows the template's main sections. The Change section describes the problem (offline devices receiving the admission card again), the resulting behavior, and the files touched. It n…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: an accepted It's me also closes the original admission for offline devices (S2P-11). The raw summary covers the journal write, the confirmsAdmission matching change, the strict-mode ordering in decide(), and the tests that match this behavior. The title is specific and accurate, and the ticket reference helps scanning. Some detail (the strict-mode decide() fix and the JOURNAL_MAX doc change) is omitted, which is acceptable.

Full details: Description check

Explanation

The description follows the template's main sections. The Change section describes the problem (offline devices receiving the admission card again), the resulting behavior, and the files touched. It names the ledger item and device rows, and it states there are no new exports and no wire-schema change. The Validation section lists the commands run with results, including the test files and the single skipped test with its reason. The template asks for a linked issue for features, but this is a fix tied to an internal ledger item (S2P-11) and a prior PR (#4370), so the link requirement does not clearly apply. HTTP/WS contract-test coverage is described in the test notes (the It's me route contract test), though the description does not name that file explicitly. Its only omission is a short note that the contract-test coverage is in the route test.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 74e92d4 and df98318.

Files selected for processing: 5

  • server/account/device-journal.test.ts
  • server/account/device-journal.ts
  • server/account/its-me-route.contract.test.ts
  • src/lib/deviceNotices.ts
  • src/lib/useDeviceNotices.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@devswha
devswha merged commit 721aa78 into main Nov 20, 2026
23 checks passed
@devswha

devswha commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head df9831829. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit reviewed this head.

Reviews at df98318: omo gate reviewer (gate4383-gate-review.md) APPROVE, no findings; dori review via relay-hub t13t; security-triage t13r YES on access. CodeRabbit did not review this head. Behind OVIS_ACCOUNT_OPENS_ALL. Merged by the lane (s2-postponed) on relay-hub's go.

@devswha
devswha deleted the fix/s2p-11-its-me-close branch November 20, 2026 22:51
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