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: Prevent trackEvent being called multiple times for #23633

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

darkwing
Copy link
Contributor

@darkwing darkwing commented Mar 21, 2024

Description

The trackEvent calls for EmptyBuyBannerDisplayed and EmptyReceiveBannerDisplayed are being called far too many times on the home screen. This PR ensures the event is tracked only once per tab render.

Open in GitHub Codespaces

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/2265

Manual testing steps

  1. Add a logpoint or breakpoint to ui/components/app/asset-list/asset-list.js's useEffect to ensure the event is only tracked once.

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • 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.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@darkwing darkwing requested a review from a team as a code owner March 21, 2024 17:15
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.

@darkwing darkwing added team-wallet-ux needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. labels Mar 21, 2024
Copy link

codecov bot commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.53%. Comparing base (09a833d) to head (f507ebe).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #23633   +/-   ##
========================================
  Coverage    68.53%   68.53%           
========================================
  Files         1154     1154           
  Lines        44026    44026           
  Branches     11789    11789           
========================================
  Hits         30170    30170           
  Misses       13856    13856           

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

@DDDDDanica
Copy link
Contributor

Trying to validate it locally, and encountered multiple metric sent whenever open the popup, can you validate that this is correct behavior?

empty-banner-event.mov

@DDDDDanica
Copy link
Contributor

#23633 (comment)
Just discussed with @darkwing offline and this is expected.

LGTM !

@bergeron
Copy link
Contributor

oooo nice find

@DDDDDanica DDDDDanica merged commit 0e17f9b into develop Mar 22, 2024
71 of 72 checks passed
@DDDDDanica DDDDDanica deleted the fix-infinite-trackEvent branch March 22, 2024 19:17
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2024
@metamaskbot metamaskbot added release-11.14.1 Issue or pull request that will be included in release 11.14.1 release-11.14.0 Issue or pull request that will be included in release 11.14.0 and removed release-11.14.1 Issue or pull request that will be included in release 11.14.1 labels Mar 22, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-11.14.0 on PR. Adding release label release-11.14.0 on PR and removing other release labels(release-11.14.1), as PR was added to branch 11.14.0 when release was cut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. release-11.14.0 Issue or pull request that will be included in release 11.14.0 team-wallet-ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants