Repository navigation
refactor(server): simplify the preferred-address race from #34 - #41
Merged
Merged
Conversation
No behaviour change. - ServerLinkStore.race starts every address at once again; addresses outside firstAttemptURLs wait on one gate that opens after preferredHeadStart or once every first address has failed. This replaces the null-sentinel channel, the head-start job and the two copies of the "start the rest" block. - OpenCodeServer.preferredCandidateURLs folded into firstAttemptURLs. Its "every address preferred" case already gave every address. - Pairing redemption no longer puts the redeemed origin first in preferredURLs: it is already one of the code's addresses, and preferredURLs is only used as a set. - OpenCodePairingLink's Listed class dropped; Payload has the same fields. - Parity rows for #34 shortened. Verified: check :feature:settings :server :app on the VM (all pass). Emulator: session-lab behind two pairing proxies (A, the code's address, 400 ms late; B, reported, at once). Paired by a pair link naming only A: all traffic to A; relaunch stays on A; A stopped -> B; A restarted -> A.
This was referenced Nov 12, 2026
Merged
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #34. No behaviour change.
The race in #34 started the code's addresses first and the rest later, using a null-sentinel channel, a head-start job and two copies of the "start the rest" block. Now every address is launched at once, as before #34, and the others wait on one gate that opens after the 1.5 s head start or once every first address has failed.
preferredCandidateURLsfolded intofirstAttemptURLs; its "every address preferred" case already gave every addresspreferredURLs: it's already one of the code's addresses, and the list is only used as a setOpenCodePairingLink.Listeddropped;Payloadhas the same fieldsKept: the direct-LAN exception (the desktop QR and
pair --remotename only the tunnel) and the early start when every first address fails (an unreachable tailnet name fails fast).Verified:
check :feature:settings :server :apppasses. On an emulator, with session-lab behind two pairing proxies (A, the code's address, 400 ms late; B, reported, at once) and a pair link naming only A: all traffic goes to A, a relaunch stays on A, stopping A falls back to B, restarting A goes back to A.