Repository navigation
fix(clients): pairing a new server at a saved address replaces the one saved there - #36312
Open
juliusmarminge wants to merge 1 commit into
Conversation
…e saved there Saved environments are keyed by the server's id, and pairing never looked at the address. A server with fresh state at a saved address was added beside the old entry, which stayed stuck on "does not match" until it was removed by hand. After a pairing at an HTTPS or loopback address, other environments drop their route there, since that address reaches one server and it has just confirmed its id. An environment with no other route is forgotten. One whose only other routes borrow that address's login is left as it is: those routes may still reach it, and removing the address would take them and the environment's saved data with it. Only a pairing does this, never an edited URL, and a plain HTTP LAN address is left alone because it can be another machine on another network. Fixes #15802 Co-authored-by: Theo Browne <me@theo.li> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Pairing now automatically removes stale saved routes and can forget the previous environment, including its associated local data. Human confirmation is needed that this automatic cleanup is the intended default behavior. You can add or adjust custom eligibility rules. Learn more. |
This branch has not been 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.
Rewritten rather than taken from the original, whose guard counted routes before removing dependents. After a real pairing (register with paired: true, set only by registerPairingConnection) at an HTTPS or loopback address, each other user environment with a route at that address is handled under its own lease: if routes remain after dropping the stale route and the learned routes borrowing its login, only those are dropped; if the stale route was its sole route, the environment is removed (the #15802 loopback case, reviewer finding 2); if only borrowed routes would remain, it is left untouched so no saved data is deleted (reviewer finding 1). Platform-managed environments, SSH routes, edited URLs and plain HTTP LAN addresses are never affected, and a failure in the cleanup is logged without failing the pairing. One table-style test in registry.test.ts covers all five cases and asserts the cache and owned-data clears happen for the sole-route environment only. Fixes #15802 for HTTPS and loopback addresses.
Fixes #15683
Supersedes #25807. The change is @t3dotgg's; their commits are kept.
Layer 3 of 3, on top of #36311.