fix(predict): make fee exemption logic feature-flag-driven in PredictMarketDetails cp-7.69.0#27090
Conversation
…ails Replace hardcoded 'Middle East' tag check with feature-flag-driven waiveList matching via selectPredictFeeCollectionFlag selector, aligning PredictMarketDetails with the existing pattern in PredictController and PolymarketProvider. - Switch parsePolymarketEvents tag mapping from label to slug to match waiveFees() slug-based matching - Add selectPredictFeeCollectionFlag selector reading from remote config - Use waiveList from fee collection config for fee exemption in UI - Add defensive optional chaining on tags access - Add selector tests for selectPredictFeeCollectionFlag - Update PredictMarketDetails tests to use slug-based tags and provide RemoteFeatureFlagController state with waiveList config
|
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. |
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.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
The changes are well-contained within the Predict module with comprehensive unit tests. SmokePredictions is the primary tag for Polymarket prediction market testing. Per the tag descriptions, SmokeWalletPlatform is needed because "Predictions is also a section inside the Trending tab" and SmokeConfirmations is needed because "opening/closing positions are on-chain transactions". Performance Test Selection: |
The committed fixture schema is out of date. To update, comment: |
|



Description
The fee exemption logic in
PredictMarketDetailswas hardcoded to check for a'Middle East'tag label, whilePredictControllerandPolymarketProvideralready used a feature-flag-driven approach viafeeCollection.waiveList. This PR aligns the UI layer with the existing pattern:parsePolymarketEvents: Switch tag mapping fromt.labeltot.slugso parsed market tags match the slug-basedwaiveListentries used bywaiveFees()selectPredictFeeCollectionFlag: New selector that reads thepredictFeeCollectionremote feature flag, falling back toDEFAULT_FEE_COLLECTION_FLAGPredictMarketDetails: Replace hardcodedtags?.includes('Middle East')withtags?.some(slug => waiveList.includes(slug))driven by the selectortagsaccess for safetyChangelog
CHANGELOG entry: null
Related issues
Fixes: PRED-736
Manual testing steps
Screenshots/Recordings
Before
N/A — logic change only, no visual diff
After
N/A — logic change only, no visual diff
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes Predict market
tagsfrom human-readable labels to slugs and uses remotepredictFeeCollection.waiveListto control fee-exemption UI, which could affect any UI/analytics expecting label-form tags. Logic is straightforward and covered by updated/additional selector and view tests.Overview
Aligns fee-exemption behavior in
PredictMarketDetailswith the fee-collection feature flag by replacing the hardcoded'Middle East'tag check with awaiveList(slug) match from the newselectPredictFeeCollectionFlagselector (defaulting toDEFAULT_FEE_COLLECTION_FLAG).Updates Polymarket parsing to store market
tagsas tag slugs (t.slug) instead of labels, and adjusts tests to validate the new slug-based exemption behavior plus selector fallbacks when the remote flag is missing/null/undefined.Written by Cursor Bugbot for commit daf0e58. This will update automatically on new commits. Configure here.