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

Why this matters

frontend/src/components/dashboard/dashboard-view.tsx:454-468 - the effect's deps are [streamEvents, session.publicKey], and streamEvents gets a new array on every SSE event, so it calls fetchDashboardData (two fetches) once per event. There is no debounce and no AbortController, so a burst of events triggers a refetch storm, and overlapping responses can resolve out of order so setSnapshot may commit stale data.

Acceptance criteria

  • Debounce/coalesce SSE-driven refetches (or react only to the latest event id)
  • Cancel the previous in-flight fetchDashboardData (AbortController) before starting a new one, and ignore stale resolutions
  • Consider migrating dashboard data to react-query with a typed key for built-in dedupe/cancellation

Files to touch

  • frontend/src/components/dashboard/dashboard-view.tsx
  • frontend/src/lib/dashboard.ts

Out of scope

  • Duplicate fetchDashboardData on mount

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingfrontendFrontend related tasks

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions