chore(runway): cherry-pick fix: add hasPerpsMarket to token details opened event cp-7.73.0#28377
Conversation
…pened event cp-7.73.0 (#28242) ## **Description** Updates the TOKEN_DETAILS_OPENED analytics event to include has_perps_market and severity properties, providing richer context about the token details screen state when the event fires. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: adds event property to token details opened event ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] 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](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Medium risk because it changes when `TOKEN_DETAILS_OPENED` fires by deferring until market insights and perps market data settle, which can impact analytics timing/volume. UI behavior is largely unchanged, but the added async coordination and stale-payload guarding could introduce missed/duplicated events if incorrect. > > **Overview** > **Enhances `TOKEN_DETAILS_OPENED` analytics** to include `has_perps_market` and `severity` (from security data), and refactors the tracking so it fires only once per token+source. > > Tracking is now **deferred in `TokenDetailsRouteWrapper`** until both market-insights display resolution and perps market lookup are settled, with a token-key guard to drop stale market-insights callbacks after navigation. > > Updates `AssetOverviewContent`’s `onMarketInsightsDisplayResolved` callback to return `{ isDisplayed, severity }` (instead of a boolean) and adjusts unit tests accordingly, plus adds an e2e page-object retry loop for reading the Perps balance value more reliably. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1d0cda9. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Prithpal Sooriya <prithpal.sooriya@users.noreply.github.com> Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
|
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. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/7.73.0 #28377 +/- ##
=================================================
Coverage ? 82.91%
=================================================
Files ? 4874
Lines ? 126414
Branches ? 28346
=================================================
Hits ? 104816
Misses ? 14391
Partials ? 7207 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - skip-smart-e2e-selection label found All E2E tests pre-selected. |
|
✅ E2E Fixture Validation — Schema is up to date |
|



Description
Updates the TOKEN_DETAILS_OPENED analytics event to include
has_perps_market and severity properties, providing richer context about
the token details screen state when the event fires.
Changelog
CHANGELOG entry: adds event property to token details opened event
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Medium risk because it changes when
TOKEN_DETAILS_OPENEDfires bydeferring until market insights and perps market data settle, which can
impact analytics timing/volume. UI behavior is largely unchanged, but
the added async coordination and stale-payload guarding could introduce
missed/duplicated events if incorrect.
Overview
Enhances
TOKEN_DETAILS_OPENEDanalytics to includehas_perps_marketandseverity(from security data), and refactorsthe tracking so it fires only once per token+source.
Tracking is now deferred in
TokenDetailsRouteWrapperuntil bothmarket-insights display resolution and perps market lookup are settled,
with a token-key guard to drop stale market-insights callbacks after
navigation.
Updates
AssetOverviewContent’sonMarketInsightsDisplayResolvedcallback to return
{ isDisplayed, severity }(instead of a boolean)and adjusts unit tests accordingly, plus adds an e2e page-object retry
loop for reading the Perps balance value more reliably.
Written by Cursor
Bugbot for commit
1d0cda9. This will update automatically
on new commits. Configure
here.
Co-authored-by: Prithpal Sooriya prithpal.sooriya@users.noreply.github.com
Co-authored-by: Prithpal Sooriya prithpal.sooriya@gmail.com af4d7ea