fix(predict): hide empty dynamic feed filters#33374
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The SmokePredictions tag is the appropriate selection because:
Per SmokePredictions tag description, when selecting SmokePredictions, also select SmokeWalletPlatform (Trending section) and SmokeConfirmations. However, the changes here are to the filter options logic (not to position opening/closing or transaction flows), so the risk to confirmations is minimal. Still, following the tag dependency guidance, SmokeWalletPlatform should be included since Predictions is a section inside the Trending tab. The test file changes are unit tests only and don't affect E2E behavior directly, but the production code change in PolymarketProvider.ts warrants running the Predictions smoke tests to validate the filter option behavior works correctly end-to-end. Performance Test Selection: |
|
⚡ Performance Test Results
✅ All tests passed · 3 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ✅ Passed Tests (3)
Branch: |



Description
Polymarket's
omit_empty=truerelated-tags response only removes globally empty tags. Dynamic filter chips in the feature-flagged Predict home redesign could therefore resolve to zero visible markets after applying the feed parameters and client visibility rules.This change validates each normalized dynamic filter with its exact market-list parameters and the same standalone-market and staleness filtering used by the redesigned feed. Filters with no visible markets are omitted while valid filters remain available. Regression coverage verifies both hidden-market filtering and preservation of the configured market page size.
Changelog
CHANGELOG entry: null
Related issues
Fixes: PRED-1085
Manual testing steps
Screenshots/Recordings
N/A: This is a provider-level filtering change covered by automated tests; no screenshots or recordings were captured.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an examplelistFilterOptionsandlistMarketscontroller operations are already traced; this change adds no new operation.For performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Adds one
listMarketscall per dynamic filter at load time (parallel), which increases API load and could slow filter discovery, but changes are confined to feed filter chips with no auth or funds impact.Overview
Dynamic Polymarket related-tag filters can still appear in the redesigned Predict home even when no markets would show after feed params and client-side visibility rules—API
omit_emptyonly drops globally empty tags.PolymarketProvider.listFilterOptionsnow probes each normalized option withlistMarkets(option.params), then keeps the chip only ifgetVisiblePredictMarkets(filterStandaloneMarkets(markets))has at least one market (same pipeline as the feed/carousel hooks). Options that would render an empty list are dropped.Tests add
createVisibleMarket, stublistMarketson existing filter-option cases, and cover hiding filters with only child/empty-outcome markets plus honoringbaseParams.limitduring validation.Reviewed by Cursor Bugbot for commit b36370b. Bugbot is set up for automated code reviews on this repo. Configure here.