Skip to content
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

fix: Fix snaps permission connection for CHAIN_PERMISSIONS feature flag #27459

Merged
merged 4 commits into from
Sep 30, 2024

Conversation

jiexi
Copy link
Contributor

@jiexi jiexi commented Sep 27, 2024

Description

Recent permission flow changes introduced behind the CHAIN_PERMISSIONS feature flag have broken permission connection for Snaps. This PR fixes it by removing an incorrect forced route direct in the permission connection component.

Open in GitHub Codespaces

Related issues

Fixes: #26635

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

render={() =>
process.env.CHAIN_PERMISSIONS && !permissionsRequest?.diff ? (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you briefly explain why !permissionsRequest?.diff isn't necessary anymore?

Copy link
Contributor Author

@jiexi jiexi Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (
permissionsRequest?.diff?.permissionDiffMap?.[
PermissionNames.permittedChains
]
) {
history.replace(confirmPermissionPath);
}

This guard was ensuring that the incremental request for permittedChains goes to the confirmPermissionPath route in the first place. Now the new ConnectPage component has been moved out of the confirmPermissionPath and into the connectPath route.

I recommend viewing the file as a whole as the github diff makes it a little bit difficult to notice this change

@jiexi jiexi changed the title Jl/fix snaps connect flow fix: Fix snaps permission connection for CHAIN_PERMISSIONS feature flag Sep 27, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
16.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@jiexi jiexi marked this pull request as ready for review September 27, 2024 16:32
@jiexi jiexi requested a review from a team as a code owner September 27, 2024 16:32
@metamaskbot
Copy link
Collaborator

Builds ready [ed3311a]
Page Load Metrics (1792 ± 83 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26523251581567272
domContentLoaded14422206176315273
load14492330179217383
domInteractive186835147
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 106 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adonesky1 adonesky1 merged commit b44e890 into develop Sep 30, 2024
81 of 83 checks passed
@adonesky1 adonesky1 deleted the jl/fix-snaps-connect-flow branch September 30, 2024 16:48
@github-actions github-actions bot locked and limited conversation to collaborators Sep 30, 2024
@metamaskbot metamaskbot added the release-12.6.0 Issue or pull request that will be included in release 12.6.0 label Sep 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.6.0 Issue or pull request that will be included in release 12.6.0 team-wallet-api-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants