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: Ensure network request to ledger bridge is not made during onboarding #24890

Merged
merged 1 commit into from
May 31, 2024

Conversation

danjm
Copy link
Contributor

@danjm danjm commented May 30, 2024

Description

Currently during onboarding, a network request is made to our github.io ledger bridge page. We want to prevent this until later.

The PR ensures that the requests made as a result of establishing a connection with ledger when submitting a password or restoring a vault only happen if the user is already onboarded. Then, when the user goes to the hardware connection page, the communication with the ledger bridge will begin.

Because setting the ledger transport type no longer happens during onboarding, we now make sure it happens during hardware wallet connection

Open in GitHub Codespaces

Manual testing steps

  1. Install and onboarding. There should be no network requests to the github pages ledger bridge during or immediately after onboarding
  2. Go to the hardware wallet connect screen and select ledger. There will now be a network request to the ledger bridge
  3. You should be able to successfully connect your ledger hardware wallet

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've completed the PR template to the best of my ability
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

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.

@danjm danjm requested a review from a team as a code owner May 30, 2024 00:53
@danjm danjm changed the title Ensure network request to ledger bridge is not made during onboarding fix: Ensure network request to ledger bridge is not made during onboarding May 30, 2024
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.

@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 30, 2024
Copy link

codecov bot commented May 30, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 65.72%. Comparing base (038dbbb) to head (fd79f50).
Report is 19 commits behind head on develop.

Files Patch % Lines
app/scripts/metamask-controller.js 66.67% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #24890      +/-   ##
===========================================
- Coverage    65.76%   65.72%   -0.03%     
===========================================
  Files         1366     1366              
  Lines        54275    54282       +7     
  Branches     14105    14109       +4     
===========================================
- Hits         35690    35676      -14     
- Misses       18585    18606      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@darkwing darkwing left a comment

Choose a reason for hiding this comment

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

With this I was able to add a Ledger after onboarding. WFM!

@metamaskbot
Copy link
Collaborator

Builds ready [fd79f50]
Page Load Metrics (945 ± 576 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint68166962713
domContentLoaded9171221
load6028859451199576
domInteractive9171121
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 232 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@danjm danjm merged commit 6994118 into develop May 31, 2024
84 checks passed
@danjm danjm deleted the prevent-ledger-network-request branch May 31, 2024 00:49
@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
@danjm
Copy link
Contributor Author

danjm commented May 31, 2024

I am working on some tests for this. The e2e ones are tricky because the network requests happen in an iframe within the offscreen document. I put my work on the tests on pause, but will prioritize as soon as the MV3 RC is created (so tomorrow some time)

@metamaskbot metamaskbot added release-11.18.0 release-11.16.6 Issue or pull request that will be included in release 11.16.6 and removed release-11.18.0 labels May 31, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-11.16.6 on PR. Adding release label release-11.16.6 on PR and removing other release labels(release-11.18.0), as PR was cherry-picked in branch 11.16.6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-privacy INVALID-PR-TEMPLATE PR's body doesn't match template release-11.16.6 Issue or pull request that will be included in release 11.16.6 team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants