feat: defer eligibility to allow for onboarding to proceed without le…#8197
Open
feat: defer eligibility to allow for onboarding to proceed without le…#8197
Conversation
…aking private url
…OnFeatureFlagChange to refreshEligibility()
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.
Member
Author
|
@metamaskbot publish-previews |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
7 tasks
abretonc7s
requested changes
Mar 16, 2026
Contributor
abretonc7s
left a comment
There was a problem hiding this comment.
We cant modify core directly, it should come from mobile than sync to core or we loose mobile as source of truth
Open
7 tasks
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
Add
deferEligibilityCheckconstructor option that prevents the eager geolocation fetch toon-ramp.api.cx.metamask.io/geolocationfrom firing during wallet onboarding, fixing a privacy compliance violation in the extension's maximum-privacy onboarding E2E testAdd
startEligibilityMonitoring()public method that the consumer calls post-onboarding to read the current feature flag state, perform the initial eligibility check, and unblock the already-registeredRemoteFeatureFlagController:stateChangesubscriptionImplementation uses a single guard in
refreshEligibilityOnFeatureFlagChangeNote: This does not update the perps-controller to use the new geolocation service. This would require removing the existing
EligibilityServicein order to keep the change as minimal as possible to unblock extension development. We can revisit to migrate to this new service soon after the blocked extension PRs have been merged.References
Checklist
Note
Medium Risk
Changes the timing of geo-blocking eligibility evaluation, which can affect whether users are allowed into perps flows until monitoring is started. Risk is moderate due to new constructor option/public method and potential integration misuse (forgetting to call
startEligibilityMonitoring()).Overview
Adds
deferEligibilityChecktoPerpsControllerOptionsto skip eligibility/geolocation checks during controller construction and gate subsequentrefreshEligibility()runs behind an internal deferral flag.Introduces
startEligibilityMonitoring()(also messenger-exposed) to resume eligibility monitoring post-onboarding by reading currentRemoteFeatureFlagControllerstate and triggering the initial eligibility refresh, with new tests covering deferred vs default behavior and changelog updates.Written by Cursor Bugbot for commit d9c9893. This will update automatically on new commits. Configure here.