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: issue where queued request counts were not included in logic to reroute from home screen and close notification #25454

Merged
merged 8 commits into from
Jun 21, 2024

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Jun 20, 2024

Description

We introduced logic to add queued requests (pending requests not yet in the ApprovalController) to the trayIcon badge number, but failed to account for these requests in two other crucial spots:

Open in GitHub Codespaces

Related issues

Fixes: #25412
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2677

Manual testing steps

  1. Import a ledger account
  2. Connect ledger account to dapp 1 with sepolia (or any network)
  3. Connect a MM account to dapp 2 with mainnet (or any network)
  4. Trigger a tx from dapp 1 with ledger
  5. Trigger a tx from dapp 2 with MM account
  6. Confirm tx 1
  7. You should see a loading screen in the pop up waiting for you to confirm on your hardware wallet
  8. Confirm in your hardware wallet
  9. You should now see the transaction from dapp 2 on mainnet

Screenshots/Recordings

Before

Screen.Recording.2024-06-20.at.4.51.16.PM.mov

After

Screen.Recording.2024-06-20.at.4.44.57.PM.mov

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.

…eroute from home screen and close notification
@adonesky1 adonesky1 requested a review from a team as a code owner June 20, 2024 21:30
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.

@jiexi
Copy link
Contributor

jiexi commented Jun 20, 2024

Verified that this resolves the issue for me

@adonesky1 adonesky1 force-pushed the ad/fix/queued-request-counts branch from ce2bda5 to 34b4be2 Compare June 20, 2024 22:13
Comment on lines +630 to +635
const unapprovedTxRequests = getApprovalRequestsByType(
state,
ApprovalType.Transaction,
);
return (
hasUnapprovedTransactionsInCurrentNetwork(state) ||
unapprovedTxRequests.length > 0 ||
Copy link
Contributor Author

Choose a reason for hiding this comment

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

since we queue requests on different dapps which can be on different networks now we don't want to restrict this boolean check to only transactions that match the currently selected network. I'm not actually sure how there could have been pending transactions on different networks previously that necessitated this check 🤔... but I might be forgetting something

jiexi
jiexi previously approved these changes Jun 20, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [234c8ab]
Page Load Metrics (258 ± 293 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint711751012311
domContentLoaded8261242
load422395258610293
domInteractive8261242
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 100 Bytes (0.00%)
  • ui: 90 Bytes (0.00%)
  • common: 14 Bytes (0.00%)

Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 65.21%. Comparing base (a4dc9d3) to head (3a2f12c).

Files Patch % Lines
ui/pages/home/home.component.js 0.00% 1 Missing ⚠️
ui/selectors/selectors.js 66.67% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25454      +/-   ##
===========================================
- Coverage    65.22%   65.21%   -0.02%     
===========================================
  Files         1405     1405              
  Lines        55528    55530       +2     
  Branches     14587    14583       -4     
===========================================
- Hits         36218    36209       -9     
- Misses       19310    19321      +11     

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

@metamaskbot
Copy link
Collaborator

Builds ready [3a2f12c]
Page Load Metrics (47 ± 4 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6210375105
domContentLoaded9211031
load40744784
domInteractive9211031
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 100 Bytes (0.00%)
  • ui: 90 Bytes (0.00%)
  • common: 14 Bytes (0.00%)

@jiexi jiexi merged commit 889ff38 into develop Jun 21, 2024
74 checks passed
@jiexi jiexi deleted the ad/fix/queued-request-counts branch June 21, 2024 17:57
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2024
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-extension-platform team-wallet-api-platform
Projects
Archived in project
5 participants