chore: ohlcv reduce initial delay cp-7.78.0#30292
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. |
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.
Reviewed by Cursor Bugbot for commit 7ec1e9a. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Changes made:
These are internal bug fixes/improvements to a chart data streaming hook. The hook is:
No E2E test tags are warranted because:
Performance Test Selection: |
|




Description
Problem
Chart data took ~9-10 seconds to display after navigating to token details. Performance logs showed it takes approximately 9.4 seconds from WebSocket subscription until the first bar update arrives from the server.
Solution
Implemented immediate REST API polling to provide data while waiting for the first WebSocket update:
Timeline Observed
Changelog
CHANGELOG entry: OHLCV chart data now loads in ~300ms via REST API while establishing WebSocket connection, reducing initial load time from 9.4s to 300ms.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
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
Medium Risk
Changes chart data fetching timing by triggering immediate REST polls and a shorter staleness threshold, which could increase network traffic or cause unexpected polling behavior if timing assumptions are wrong.
Overview
Reduces perceived OHLCV chart load time by polling the
/latestREST endpoint immediately after a successful WebSocket subscribe, instead of waiting for the first WS bar.Shortens the WS staleness threshold from
10sto5s, tweaks stale detection to use>=, and adds basic numeric validation infetchLatestBarto drop malformed REST responses. Tests are updated to reflect the new timing and the additional initial REST fetch (many cases now expect twofetchcalls: immediate + staleness/chain-down).Reviewed by Cursor Bugbot for commit a3d5c11. Bugbot is set up for automated code reviews on this repo. Configure here.