Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0
Labels: bug, frontend, Stellar Wave
The dashboard refetches its whole snapshot once per SSE event, with no debounce and no cancellation, so a burst of events turns into a refetch storm and can commit stale data.
frontend/src/components/dashboard/dashboard-view.tsx:454-468: the effect deps are [streamEvents, session.publicKey], and streamEvents is a new array on every SSE event, so the effect runs fetchDashboardData (two fetches) every time. Nothing debounces it and there's no AbortController, so overlapping responses can resolve out of order and setSnapshot ends up writing older data on top of newer.
What the fix has to hold to
- SSE-driven refetches are coalesced/debounced (or the effect only reacts to the latest event id)
- The previous in-flight
fetchDashboardData is aborted before a new one starts, and stale resolutions are ignored
Done when
Where to start
dashboard-view.tsx and lib/dashboard.ts. Moving dashboard data onto react-query with a typed key would give you dedupe and cancellation for free and is worth considering, but the minimal fix is debounce + abort. The duplicate fetchDashboardData on mount is a separate issue, not this one.
Labels:
bug,frontend,Stellar WaveThe dashboard refetches its whole snapshot once per SSE event, with no debounce and no cancellation, so a burst of events turns into a refetch storm and can commit stale data.
frontend/src/components/dashboard/dashboard-view.tsx:454-468: the effect deps are[streamEvents, session.publicKey], andstreamEventsis a new array on every SSE event, so the effect runsfetchDashboardData(two fetches) every time. Nothing debounces it and there's noAbortController, so overlapping responses can resolve out of order andsetSnapshotends up writing older data on top of newer.What the fix has to hold to
fetchDashboardDatais aborted before a new one starts, and stale resolutions are ignoredDone when
AbortController, stale results droppedWhere to start
dashboard-view.tsxandlib/dashboard.ts. Moving dashboard data onto react-query with a typed key would give you dedupe and cancellation for free and is worth considering, but the minimal fix is debounce + abort. The duplicatefetchDashboardDataon mount is a separate issue, not this one.