fix: add hasPerpsMarket to token details opened event cp-7.73.0#28242
Conversation
|
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. |
| const [tokenDetailsOpenedFlushNonce, setTokenDetailsOpenedFlushNonce] = | ||
| useState(0); | ||
|
|
||
| const flushTokenDetailsOpenedIfReady = useCallback(() => { |
There was a problem hiding this comment.
This fct decides whether it's time to fire the TOKEN_DETAILS_OPENED analytics event. It gates on two async data sources settling before it fires.
1-Market insights must have resolved
2- Perps market lookup must have settled
|
@cursoragent READ AND FOLLOW THESE MEMORY FILES: Can you try fixing the failing E2E tests? I feel like it should be a nice simple fix. |
|
Implemented a targeted E2E stability fix for the failing Perps smoke test path. What I changedFile:
Why this should fix the CI failureThe Android smoke failure was:
This fix prevents brittle early fallback to that legacy selector by waiting/retrying for the modern balance value element first. Validation done
Git
If you want, I can also add a narrow regression spec/assertion around this balance-element fallback behavior so this class of flake is caught earlier in CI. Reflection Statement: Existing memory guidance was sufficient; no new reusable insight needed beyond this targeted selector-stability fix. Also, since I had to run a full
|
Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Changes analyzed:
Tag dependency chain:
Not selected:
Performance Test Selection: |
|
✅ 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
Pre-merge reviewer checklist
Note
Medium Risk
Medium risk because it changes when
TOKEN_DETAILS_OPENEDfires 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_OPENEDanalytics to includehas_perps_marketandseverity(from security data), and refactors the tracking so it fires only once per token+source.Tracking is now deferred in
TokenDetailsRouteWrapperuntil 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’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.