Skip to content

fix(relay): name the regional relay in pairing links without a code - #2882

Merged
devswha merged 4 commits into
mainfrom
fix/relay-link-regional
Nov 5, 2026
Merged

devswha merged 4 commits into
mainfrom
fix/relay-link-regional

Conversation

@devswha

@devswha devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner

What

/api/relay/link, the pairing link without a code that a phone pairs through by comparing digits, named the global relay (this.relay) even when the PC had chosen a regional one. QR offers already name this.advertised: the regional relay while its link is online, the global one otherwise. pairingLink() now uses this.advertised too, so digit-comparison pairings start on the nearby relay.

Found while verifying relay-ap.ovis.sh after updating it to main: a QR pairing through relay-ap took 1.1 s, while the same PC's code-free link sent the phone to relay.ovis.sh (18 s for the QR pairing through it from Korea). With the link's relay set to relay-ap, a real digit-comparison pairing (main's phone channel against an isolated PC, approved on the PC) completed through relay-ap in 0.1 s.

A phone whose saved relay is a regional one still falls back to the global relay when it cannot get through (#2832), and the PC stays on both, so nothing new can strand a phone.

Validation

  • Failing first: server/relay/service.contract.test.ts "names the relay new offers name in a pairing link without a code too" failed on 8489d8d8 (wss://global.test instead of wss://regional.test) and passes with the fix. It also checks the global relay while the regional link is down, and for a PC that chose no regional relay.
  • server/relay/service.contract.test.ts: 43 pass.
  • bun run check fast: all ok.

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4f1c072 and 0660f25.

Files selected for processing: 4

  • changelog.d/relay-link-regional.md
  • docs/relay.md
  • server/relay/service.contract.test.ts
  • server/relay/service.ts
  • 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

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate (owner-approved): the head is a clean merge of origin/main on top of the reviewed commit (omo CLEAR there; no PR-file change since), and bun run check fast passed at this head. Linux-only change. Merged without waiting for GitHub CI.

@devswha
devswha merged commit af9a570 into main Nov 5, 2026
8 checks passed
@devswha
devswha deleted the fix/relay-link-regional branch November 5, 2026 07:15
@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate: FAIL

Local merge gate: FAIL #2882 merge=8a1060483107 head=14597f4b9dc6 main=e69773489083 on devswha-ThinkStation-P620 CPUs 96-127 in 3348s, reruns=3

The Linux suites of the required checks (Fast checks, Integration and browser), run on main e697734 with this PR's head 14597f4 merged in (local merge 8a1060483107, not pushed), on devswha-ThinkStation-P620 CPUs 96-127 (a reserved slice, 4% busy before the start, host load 49.27; shards=4 browser_main_workers=2 browser_other_workers=6). Native Windows install and the macOS checks are not part of this gate.

Step Command Result Seconds Counts
release-guards bun scripts/release-guards.ts --base e69773489083 fail (exit 0
  1. | 1
    0 | -
  • |
    | install | bun install --frozen-lockfile | fail (exit 0
  1. | 0
    0 | -
  • |
    | fast | bun run check fast | fail (exit 0
  1. | 236
    180 | tests 23218 pass / 0 fail; check steps 7 ok / 0 failed
    tests 23218 pass / 0 fail; check steps 6 ok / 0 failed |
    | integration | HERDR_TEST_SHARDS=<shards> bun run check integration | fail (exit 1
  2. | 174
    185 | tests 1068 pass / 7 fail; check steps 1 ok / 2 failed
    tests 1067 pass / 8 fail; check steps 1 ok / 2 failed |
    | integration-rerun | bun run check run -- bun test --timeout 15000 <each failed file> | fail (exit 1
  3. | 0
    0 | -
  • |
    | browser-build | bun run build && bun run build:shell | fail (exit 0
  1. | 5
    7 | -
  • |
    | browser-main | BROWSER_SCRIPTS=ui-regression,ui-contexts-regression bun run check run -- bun scripts/ci-browser-parallel.ts | fail (exit 0
  1. | 338
    354 | browser scripts 2/2 passed
    browser scripts 2/2 passed |
    | browser-other | BROWSER_EXCLUDE=<those two> bun run check run -- bun scripts/ci-browser-parallel.ts | fail (exit 1
  2. | 901
    955 | check steps 0 ok / 3 failed; browser scripts 143/146 passed
    check steps 0 ok / 2 failed; browser scripts 144/146 passed |

Reruns:

  • integration not rerun: server/api.contract.test.ts: error: expect(received).toContain(expected)
  • integration not rerun: server/api.contract.test.ts: error: expect(received).toContain(expected)
  • browser scripts/relay-e2e-regression.ts failed, then passed on its automatic second run

Total 3348s.

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Note on the "Local merge gate: FAIL" comment above: that run used an early version of the gate script that ran the suites on the host instead of in the CI runner image. The host has a different herdr (0.9.5 vs the pinned 0.9.3), Node and inherited HERDR_* variables, which makes these copilot/api/hermes contract tests and the Grok browser QA time out on main too. The gate now runs inside the CI image, where those suites pass. Nothing in this PR is involved (it changes only pairingLink in server/relay/service.ts and its test).

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