Skip to content

[Frontend] Dashboard refetches full snapshot per SSE event with no debounce or cancellation - request storm and out-of-order setSnapshot #857

Description

@grantfox-oss

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

  • Refetches debounced/coalesced
  • Previous fetch cancelled via AbortController, stale results dropped
  • lint + typecheck + tests green

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.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendFrontend related tasks

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions