fix(predict): use correct payload for dynamic market subscriptions cp-8.3.0#33289
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:
This is a functional change to how Polymarket WebSocket subscriptions work — specifically fixing/improving the behavior when subscribing to additional tokens after a connection is already established. This directly impacts the Predictions feature's ability to receive real-time market data. SmokePredictions is selected as the primary tag since this is core Polymarket functionality. Per the tag description, SmokePredictions requires also selecting SmokeWalletPlatform (Predictions is a section inside Trending tab) and SmokeConfirmations (opening/closing positions are on-chain transactions). No other areas are affected — this is isolated to the Polymarket WebSocket provider. Performance Test Selection: |
|



Description
Fixes live price updates for market tokens added after the Polymarket WebSocket connection is already open.
Initial and reconnect subscriptions continue using the market connection payload, while dynamic token additions now use Polymarket's
subscribeoperation. Previously, dynamically added tokens were sent using the initial connection payload and were not subscribed, preventing components such as moneyline cards and charts from receiving updates.Regression tests cover dynamic price and orderbook subscriptions while preserving initial and reconnect behavior.
Changelog
CHANGELOG entry: Fixed live prediction market prices not updating for dynamically subscribed markets
Related issues
Refs: https://consensyssoftware.atlassian.net/browse/PRED-1092
Manual testing steps
Automated verification:
npx jest app/components/UI/Predict/providers/polymarket/WebSocketManager.test.ts --coverage=falseScreenshots/Recordings
N/A — this change fixes the WebSocket subscription payload and has no visual changes.
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an examplePre-merge reviewer checklist
Note
Low Risk
Targeted WebSocket subscription payload fix in Predict Polymarket provider with tests; initial/reconnect behavior unchanged.
Overview
Fixes live prediction market prices when tokens are subscribed after the Polymarket market WebSocket is already open (e.g. moneyline cards/charts on game details).
WebSocketManagernow sends{ type: 'market', assets_ids }only for the first connection and reconnect resubscribe, and{ operation: 'subscribe', assets_ids }when price or orderbook subscriptions are added on an open socket. Previously, dynamic adds reused the initial payload and Polymarket did not subscribe those assets.Regression tests assert the subscribe payload for late-added market prices and orderbooks.
Reviewed by Cursor Bugbot for commit 8c7484e. Bugbot is set up for automated code reviews on this repo. Configure here.