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: confirmation badge - max unlock request badge size #26162

Closed

Conversation

Prithpal-Sooriya
Copy link
Contributor

@Prithpal-Sooriya Prithpal-Sooriya commented Jul 26, 2024

Description

I don't see a reason for the unlock counter to be >1. All unlock counts will vanish as soon as the wallet is unlocked.
Otherwise I am open to adding a larger bounds (but this will ideally prevent the counter from having 1000+ count on the fox counter for confirmations)

Open in GitHub Codespaces

Related issues

Fixes: #26064

  • This prevents snaps from constantly increasing the unlock request badge size (e..g prevent 1000+ count on the confirmations badge)

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.

I don't see a reason for the unlock counter to be >1. All unlock counts will vanish as soon as the wallet is unlocked
@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner July 26, 2024 13:54
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 team-notifications Notifications team label Jul 26, 2024
Copy link

Comment on lines +1018 to +1021
const unlockCount = Math.min(
controller.appStateController.waitingForUnlock.length,
1,
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Context: This waitingForUnlock is an array of promises from requests internally (any maybe externally) that require the wallet to be unlocked. As soon as the wallet is unlocked, all of these promises get resolved.

From a UI perspective, I don't see why we need to have more than 1 unlock count - especially as all the requests will get resolved once the wallet is unlocked.

Otherwise we can add a larger bound here. This will prevent the unlock requests count from growing (e.g. prevent 1000+ count on the confirmations badge)

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

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

Project coverage is 69.94%. Comparing base (30dce33) to head (537d8a5).
Report is 338 commits behind head on develop.

Files Patch % Lines
app/scripts/background.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26162      +/-   ##
===========================================
- Coverage    69.94%   69.94%   -0.00%     
===========================================
  Files         1409     1409              
  Lines        49794    49795       +1     
  Branches     13769    13769              
===========================================
  Hits         34825    34825              
- Misses       14969    14970       +1     

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

@metamaskbot
Copy link
Collaborator

Builds ready [537d8a5]
Page Load Metrics (317 ± 299 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6412195188
domContentLoaded95124126
load422304317624299
domInteractive95124126
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 12 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@bschorchit
Copy link

This might already be part of the PR, but adding this here in case it's not: we should also prevent the notification window from popping up to users requesting them to unlock when those calls are made while the wallet is locked.

@Prithpal-Sooriya
Copy link
Contributor Author

This might already be part of the PR, but adding this here in case it's not: we should also prevent the notification window from popping up to users requesting them to unlock when those calls are made while the wallet is locked.

Good callout - particularly for the issue line:

After reloading / turning the extension OFF->ON popup appears automatically

This may be pre-installed snaps related - this will come under a separate notifications related PR. Will investigate to see if it resolves the issue.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team-notifications Notifications team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Confusing popup / badge behavior (develop and latest 12.0.0 build)
3 participants