Repository navigation
fix(relay): name the regional relay in pairing links without a code - #2882
Conversation
|
Warning Review limit reachedYou'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. View limit details
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. |
|
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 |
Local merge gate: FAIL
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
Reruns:
Total 3348s. |
|
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). |
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 namethis.advertised: the regional relay while its link is online, the global one otherwise.pairingLink()now usesthis.advertisedtoo, so digit-comparison pairings start on the nearby relay.Found while verifying
relay-ap.ovis.shafter 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 torelay.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
server/relay/service.contract.test.ts"names the relay new offers name in a pairing link without a code too" failed on8489d8d8(wss://global.testinstead ofwss://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.