Fix managed relay enrollment connection race#94
Merged
Conversation
burakgon
marked this pull request as ready for review
July 18, 2026 22:49
There was a problem hiding this comment.
Pull request overview
Fixes a relay-connection ownership race during managed Node enrollment by preventing the persistent browser relay transport from starting until enrollment has advanced past its short-lived proof connection, and prepares the 1.4.2 release metadata/notes.
Changes:
- Defer the persistent relay transport while
phase === "managed-enrollment"to avoid competing relay clients for the same device/route. - Add an App-shell regression assertion ensuring the persistent relay client is not started during managed enrollment.
- Bump workspace/package versions to
1.4.2and add release notes.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/web/src/App.tsx | Defers persistent relay transport during managed enrollment to prevent superseded connections. |
| packages/web/src/App.test.tsx | Mocks relay host client manager and asserts managed enrollment closes the persistent host and does not start a persistent relay client. |
| packages/web/package.json | Bumps web package version to 1.4.2. |
| packages/server/package.json | Bumps server package version to 1.4.2. |
| packages/cli/package.json | Bumps CLI package version to 1.4.2. |
| package.json | Bumps workspace version to 1.4.2. |
| CHANGELOG.md | Adds 1.4.2 release notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| disposed = true; | ||
| }; | ||
| }, [activeDirectHost, relayAttempt, relayClientManager, token, tokenHostId]); | ||
| }, [activeDirectHost, phase, relayAttempt, relayClientManager, token, tokenHostId]); |
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.
What changed
1.4.2release with user-facing notesRoot cause
Reopening an already-enrolled managed Node started two browser relay clients for the same route and device. The broker correctly superseded one connection. Once the short-lived proof client closed, the persistent client could remain in a terminal superseded state, so session polling showed
Couldn't reach the servereven though the Node and relay were healthy.Impact
Managed Cloud users can reopen an existing Node and proceed directly to Sessions without entering a retry loop or re-pairing the browser.
Validation
pnpm exec vitest run packages/web/src/App.test.tsx(43 tests)pnpm lintpnpm exec tsc -b --forcepnpm format:checkpnpm build