fix: install modal QRCode regeneration#1353
Merged
Merged
Conversation
ca7b781 to
b03c82a
Compare
ffmcgee725
reviewed
Oct 2, 2025
| const { sessionRequest } = currentConnectionRequest; | ||
| const now = Date.now(); | ||
| const remainingMs = sessionRequest.expiresAt - now; | ||
| const remainingMs = sessionRequest.expiresAt - now - 55000; |
Member
There was a problem hiding this comment.
why 55000 ? Can we have this as a descriptive constant ?
Contributor
Author
There was a problem hiding this comment.
opps sorry that was hardcoded now, my bad!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1353 +/- ##
=======================================
Coverage 74.99% 74.99%
=======================================
Files 184 184
Lines 4519 4519
Branches 1108 1108
=======================================
Hits 3389 3389
Misses 1130 1130 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
chakra-guy
approved these changes
Oct 2, 2025
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.



Explanation
Fixes the QRCode regenerating on install modals, issue affecting both install modal web and install modal node.
This change will disconnect any pending connection and renew it once the 60 seconds of the session request expire. Still this leaves enough timeout time for the user to reply without affecting.
How to test
Node
cd into playground/multichain-node
run
U should see the QRCode regenerate after the specified seconds on screen.
Web
cd into playground/multichain-react
run
Open http://localhost:3000/test-dapp-multichain
Click connect and wait for 60 seconds for the QRCode to automatically regenerate
References
Checklist
Note
Ensures QR codes auto-regenerate on expiry, starts/stops expiration checks correctly, and resets any active MWP connection before initiating a new session.
AbstractInstallModal: Stop expiration check before regenerating; refresh QR/link/expiry and re-render on each tick.ui/modals/node/install: Start expiration check inrenderQRCode; remove frommount; ensure cleanup inunmount.multichain/index.ts: Before creating a newConnectionRequest, disconnectdappClientifCONNECTEDorCONNECTING.transports/mwp/index.ts: Use a localconnectionPromisewith timeout handling duringconnect()and clear timers on completion.Written by Cursor Bugbot for commit 7bbc1a2. This will update automatically on new commits. Configure here.