Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit df7fc66. Configure here.
| const onConsentAccepted = async () => { | ||
| await completeConnection(); | ||
| }; | ||
|
|
There was a problem hiding this comment.
Stale listeners from connectTo when consent required
Medium Severity
Removing the CONSENT_ACCEPTED listener from connectTo causes the promise to hang indefinitely when consentRequired is true. The modal SDK sets consentRequired = true and internally calls connectTo from onSocialLogin and onExternalWalletLogin. When consent is required, the subscribeToConnectorEvents CONNECTED handler emits CONSENT_REQUIRING instead of CONNECTED, so connectTo's onConnected never fires and cleanup() is never called. The stale once listeners for CONNECTED, ERRORED, and AUTHORIZED accumulate on the SDK and can fire on subsequent connections, causing duplicate CONNECTION_COMPLETED analytics events.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit df7fc66. Configure here.


Jira Link
Description
Previously we need to update/persist the consent state which is only available in the no-modal, CONSENT is only available for modal and we already have the listener from modalManager. Otherwise, we will need to have two different state management for modal and no-modal to manage the consent state.
This PR remove the consent event listening in no modal which was incorrectly added.
How has this been tested?
Screenshots (if appropriate)
Types of changes
Checklist
Note
Medium Risk
Changes the
connectTopromise completion conditions in the no-modal SDK by removingCONSENT_ACCEPTEDas a completion trigger, which could affect connection timing/state transitions for apps relying on the previous behavior.Overview
Fixes no-modal connection completion to no longer resolve
connectTo()based onCONNECTOR_EVENTS.CONSENT_ACCEPTED; it now completes only onCONNECTED(andAUTHORIZEDin connect-and-sign mode).Updates consent-related tests to match the new flow and refactors test setup with an
emitMetaMaskConnectedhelper, plus disables analytics in the test SDK factory to reduce noise.Reviewed by Cursor Bugbot for commit df7fc66. Bugbot is set up for automated code reviews on this repo. Configure here.