Repository navigation
fix(remote-connect): show the Relay invitation on the first click - #3837
Merged
bobleer merged 1 commit intoNov 9, 2026
Merged
Conversation
The first "show connection code" after an app restart left the dialog spinning with no QR code until it was closed and reopened. Since the official endpoint moved to `/relay?v=<version>`, a restored session holds the endpoint base while the prepared endpoint also carries the version, so the exact string comparison always reported a different Relay. That forced a full account login, which rotated the token, dropped device routing, and emitted `account://login-state`. The dialog's listener then released the in-flight start, so its invitation was discarded and the loading state was never reset. - Compare endpoints by base when deciding whether to sign in, and when checking the prepared endpoint before issuing an invitation. The invitation link is built from the prepared endpoint, so it keeps `?v=`. - A login event now only invalidates an invitation that existed before the event; a start in flight issues its result for the new account context. - Tie the loading state to the operation so it cannot stick. - Relabel the invitation button "Hide invitation": it collapses the QR code and leaves an established connection running.
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.
Summary
After an app restart, the first click on "show connection code" for the official Relay left the dialog showing "Connected" with a spinning button and no QR code. Closing the dialog or switching views and clicking again worked.
The trigger is the
/relay?v=<version>endpoint from #3808, through a string comparison rather than an HTTP redirect. Restoring a session normalizes the stored endpoint to its base (.../relay), whileprepare_relayreturns.../relay?v=1.0.9, soremote_connect_startalways saw a different Relay and ran a full account login. That login emittedaccount://login-state, and the dialog's listener clearedpendingOwnerReffor the start still in flight.handleConnectthen discarded the invitation and skippedsetLoading(false). The login had already stored the versioned URL, so the next click matched and worked.Changes:
remote_connect_startandRemoteConnectService::startcompare endpoints by base. The invitation link is built from the prepared endpoint, so it keeps?v=.Type and Areas
Type: regression fix / UI copy
Areas: desktop/Tauri, Rust core (remote connect), web UI, locales
Motivation / Impact
The official Relay QR code appears on the first click. Showing it no longer signs the desktop in again after each restart, which also rotated the account token and dropped device routing, disconnecting attached controllers.
Remote scenarios:
Upgrade compatibility: no persisted shapes change. A session stored on the legacy
/v/1.0.2alias still migrates through one login, as before, and the dialog now handles that login without losing the invitation.Verification
Run on the previous
mainbase; this branch adds no conflicting changes from upstream (the files touched here did not change).pnpm --dir src/web-ui run test:run src/app/components/RemoteConnectDialog/RemoteConnectDialog.status.test.tsx src/app/components/RemoteConnectDialog/RemoteConnectDialog.contract.test.ts src/infrastructure/remote-connect: 61 passed. The new login-event case failed before the fix with the reported state (connected, still connecting, no invitation).cargo test --locked -p openbitfun-core --no-default-features --features remote-connect --lib service::remote_connect::host_lifecycle_tests: 9 passed.cargo test --locked -p openbitfun-desktop --lib api::remote_connect_api: 21 passed, 1 ignored (performance experiment).pnpm run type-check:webandpnpm run i18n:audit: passed.Not verified: the native app against the production Relay.
Checklist