-
Notifications
You must be signed in to change notification settings - Fork 36
fix: clear old uri before creating a new one on connecting view #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
Claude finished @ignaciosantise's task —— View job Code Review
Issues Found1. Potential useEffect Infinite Loop Risk (packages/appkit/src/views/w3m-connecting-view/index.tsx:109-123)The useEffect(() => {
WcController.clearUri();
initializeConnection();
// ...
}, [isQr]); // Missing 'initializeConnection' in dependenciesProblem: The
Recommendation: Either:
2. Missing Changeset (Required)The PR is missing a changeset, which is required for version tracking. Since this is a bug fix that clears stale URIs to prevent connection issues, it should have a patch changeset. Action needed: Add a changeset by running: npx changeset addSelect 3. Redundant URI Clearing (Minor Code Quality Issue)The
Analysis: The new call at line 111 ensures URI is always cleared when component mounts or Impact: Low - Recommendation: Consider if the clearing at line 111 makes the one at line 48 unnecessary for the initial call. The current implementation is safe but could be optimized. 4. Missing Test CoverageNo test file exists for Recommendation: Add tests covering:
SummaryThe change itself is sensible and addresses a real issue with stale URIs. However, there are concerns around the useEffect dependencies that could lead to bugs, and a changeset is required before merging. Action items before merge:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses a bug where stale WalletConnect URIs from previous connection attempts could interfere with new connections in the ConnectingView component. The fix adds a call to WcController.clearUri() at the start of the connection initialization useEffect.
Key Changes:
- Clears stale WalletConnect URI before initializing new connections in
ConnectingView
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@claude review |
|
Claude finished @ignaciosantise's task —— View job 🔄 Incremental Review: Validation of Previous Feedback Critical Issue: Cursor's Bug Report is CONFIRMEDLocation: The bug identified by Cursor is valid and serious. Here's why: The Problem Chain:
Code Evidence: // CoreHelperUtil.ts:48-49
isPairingExpired(expiry?: number) {
return expiry ? expiry - Date.now() <= ConstantsUtil.TEN_SEC_MS : true;
// ^^^^
// Always true when undefined
}Impact: Every component mount or Fix Options:
Other Previously Reported Issues - Status Check✅ Missing Changeset - Still RequiredConfirmed: No changeset exists. This is a bug fix requiring a patch changeset.
|
|



This pull request introduces a small but important improvement to the
ConnectingViewcomponent. The change ensures that any stale WalletConnect URI from previous connection attempts is cleared before initializing a new connection, which helps prevent connection issues.packages/appkit/src/views/w3m-connecting-view/index.tsx: Added a call toWcController.clearUri()at the start of theuseEffectto clear stale URIs before initializing a new connection.Note
Clears old WalletConnect URI before reconnecting, switches retry timing to a ref, and forces initial reconnect with updated QR auto-retry logic.
packages/appkit/src/views/w3m-connecting-view/index.tsx)wcURI before establishing a new connection on retry or expiry.lastRetrystate withuseRef, updating debounce and QR auto-retry logic.initializeConnection(remove extra arg) and invokeinitializeConnection(true)on mount; keep periodic pairing-expiry checks.Written by Cursor Bugbot for commit 5cb1e29. This will update automatically on new commits. Configure here.