Skip to content

fix(account): the confirm page names only one established connection - #4283

Merged
devswha merged 2 commits into
mainfrom
fix/confirm-peer-row
Nov 19, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/confirm-peer-row

Conversation

@devswha

@devswha devswha commented Nov 19, 2026

Copy link
Copy Markdown
Owner

What

Follow-up to #4277 (gate review, MEDIUM). The local confirm page names the user behind a connection from the kernel's socket table. It now counts only an established connection whose ends are exactly 127.0.0.1: and 127.0.0.1:, and names nobody when more than one row matches, so a request it cannot attribute is refused. Behind OVIS_ACCOUNT_OPENS_ALL (off by default), like the rest of the screen proof.

Tests (first, red: e9eca61)

  • Q20: only an established connection names the peer, and two exact rows name nobody.

Validation

  • bun test server/account/: 214 pass.
  • bun run typecheck: clean.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Peer identification now uses only established loopback connections with matching ports. It returns no result when there are no matches, multiple matches, or the matching UID is invalid.

peerUidInTable now considers only established TCP rows that match the requested loopback connection. It returns a UID only when exactly one row matches and the UID is a safe integer. Tests cover non-established and duplicate matches.

Changes: Local confirmation peer attribution

Layer / File(s) Summary
Filter and validate peer matches
server/account/local-confirm.ts, server/account/local-confirm.test.ts
peerUidInTable filters out non-established rows and returns a UID only for exactly one match with a safe integer UID. Tests cover TCP state filtering and duplicate established matches.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • devswha/ovis#4277: Introduces the local confirm feature whose peer attribution logic this PR updates.
Merge Risk: Minimal · up to 76c08

This tightens the local confirm page so it names a user only when exactly one established loopback connection matches. Ambiguous cases now name nobody. The feature is off by default, and no actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the confirm page now names a user only when exactly one established connection matches. It is specific, follows conventional commit style, and matches the summary and …
Description check Passed The description has a What section that explains the problem, the new matching rule, the OVIS_ACCOUNT_OPENS_ALL gating, and the test added first. The Validation section lists bun test and typecheck re…
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: the confirm page now names a user only when exactly one established connection matches. It is specific, follows conventional commit style, and matches the summary and objectives.

Full details: Description check

Explanation

The description has a What section that explains the problem, the new matching rule, the OVIS_ACCOUNT_OPENS_ALL gating, and the test added first. The Validation section lists bun test and typecheck results. It does not mention the changelog.d entry or contract-test coverage that the template references, and it does not list the fast or full check commands. These gaps are minor, so the description is mostly complete.

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 a3cdfa2 and 76c0899.

Files selected for processing: 2

  • server/account/local-confirm.test.ts
  • server/account/local-confirm.ts

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

@devswha
devswha merged commit 69b319d into main Nov 19, 2026
23 checks passed
@devswha

devswha commented Nov 19, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head 76c0899b6. 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.

step 2 per owner 2026-11-20, behind OVIS_ACCOUNT_OPENS_ALL (off); follow-up to #4277's gate MEDIUM; reviews at 76c0899: dori review CLEAR, omo gate reviewer CLEAR (red e9eca61 first), security-triage YES, relay hub CLEAR; CodeRabbit did not review this head.

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