perf(predict): use stable sports market keys - #33476
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. |
# Conflicts: # app/components/Views/TrendingView/tabs/SportsTab.test.tsx
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Impact Assessment:
Tag selection rationale:
No additional dependent tags are required per the tag descriptions for these two tags in this context. Performance Test Selection: |
|



Description
The Trending SportsTab FlashList used each market's array index as its key. Refreshing or reordering the paginated live feed could therefore bind an existing key to a different market, causing unnecessary re-renders and incorrect cell recycling.
The key now combines the active sport key with the stable market ID. A regression test verifies that a market keeps the same key when its list position changes.
Changelog
CHANGELOG entry: null
Related issues
Fixes: #31318
Manual testing steps
Automated coverage:
yarn jest app/components/Views/TrendingView/tabs/SportsTab.test.tsx --runInBand --coverage=falseScreenshots/Recordings
Before
N/A - Internal performance change with no visual output.
After
N/A - Internal performance change with no visual output.
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Localized list keying and test-only changes in Trending Sports; no auth, data, or API behavior changes.
Overview
SportsTab’s “All sports” FlashList no longer keys rows by array index. Keys are now
all_sports-{active sport}-{market id}, so refresh or pagination reordering does not remap keys to different markets.A regression test asserts the same market keeps an identical key when its index changes. The test suite describe block was broadened from the predictions carousel-only scope to SportsTab overall.
Reviewed by Cursor Bugbot for commit 97b1a83. Bugbot is set up for automated code reviews on this repo. Configure here.