Skip to content

fix: take the transport's selected pair as the outside test's path - #626

Merged
TheCryptoDonkey merged 1 commit into
mainfrom
fix/relay-test-selected-pair
Oct 30, 2026
Merged

TheCryptoDonkey merged 1 commit into
mainfrom
fix/relay-test-selected-pair

Conversation

@TheCryptoDonkey

Copy link
Copy Markdown
Member

Parity with the Android fix. The outside test required each peer's working pair to be marked nominated and succeeded. On Android, which uses the same libwebrtc, a Pixel on mobile data against a real router reported a reachable relay as failing at inbound on every run: A's working pair said nominated=false and B's said in-progress (a fresh check was out) while each transport named that pair as selected, after the echo had already crossed them.

Not seen failing on the web; the check is the same and the engine is the same.

Change: selectedPath takes the pair a transport names in selectedCandidatePairId, which needs received bytes and must not have failed. A nominated, succeeded pair decides only when no transport names one (unchanged behaviour, and what browsers without transport stats will use).

Checks: app/src/relay-outside-test.test.ts, 14 tests pass, including three new cases (selected pair not nominated, selected pair in-progress, selected pair failed). The new "not nominated" case fails on the old code.

https://claude.ai/code/session_01P4tkjt9pRAySng1JJnHn9t

The outside test required each peer's working pair to be marked
nominated and succeeded. libwebrtc's flags lag the traffic: on a phone on
mobile data the controlling peer's working pair said not nominated, and
the other peer's said in-progress while a fresh check was out, both after
the data-channel echo had crossed them. A relay that passed inbound was
reported as failing at "inbound". Seen on Android, which shares the
engine.

The path is now the pair a transport selects, which needs received bytes
and not to have failed. Only when no transport names a pair does the
nominated, succeeded one decide.
@TheCryptoDonkey
TheCryptoDonkey merged commit 81c66bd into main Oct 30, 2026
48 checks passed
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