Skip to content

perf: reduce dashboard SSE refresh and render churn#451

Merged
harsh-batheja merged 3 commits intomainfrom
perf/dashboard-sse-cadence
Mar 13, 2026
Merged

perf: reduce dashboard SSE refresh and render churn#451
harsh-batheja merged 3 commits intomainfrom
perf/dashboard-sse-cadence

Conversation

@harsh-batheja
Copy link
Collaborator

Summary

  • coalesce membership-changing dashboard SSE bursts into a single /api/sessions refresh, while keeping a low-cadence steady-state refresh so global pause and PR enrichment do not go stale
  • memoize AttentionZone and SessionCard, stabilize dashboard action callbacks, and reuse per-project session groupings so unchanged cards stay cold during same-membership updates
  • add regression coverage for refresh cadence, steady-state pause refresh behavior, and unchanged-card render stability

Measured impact

  • bursty membership churn now triggers exactly 1 /api/sessions refresh per cadence window (covered by useSessionEvents regression test)
  • same-membership snapshot updates keep unchanged cards at 1 render while the changed card advances to 2 renders (covered by Dashboard.renderCadence.test.tsx)
  • same-membership SSE traffic no longer forces immediate full refreshes, but stale pause/PR metadata is refreshed on a 15s cadence instead of every event

Validation

  • corepack pnpm --filter @composio/ao-web test -- src/hooks/__tests__/useSessionEvents.test.ts src/components/__tests__/Dashboard.renderCadence.test.tsx src/components/__tests__/Dashboard.globalPause.test.tsx src/components/__tests__/Dashboard.projectOverview.test.tsx
  • corepack pnpm --filter @composio/ao-web typecheck
  • corepack pnpm --filter @composio/ao-web build
  • corepack pnpm -r typecheck

Notes

  • the web build still reports pre-existing warnings from packages/web/src/lib/services.ts and an existing tracker-linear dependency resolution warning during Next.js compilation, but the build completes successfully

harsh-batheja and others added 2 commits March 12, 2026 23:41
Batch membership-driven refreshes behind a short cadence and keep low-frequency steady-state refreshes so pause and PR data stay current without hammering /api/sessions during SSE churn.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Keep unchanged zones and cards cold during same-membership SSE updates by stabilizing dashboard callbacks, caching project groupings, and memoizing the session view tree with a render-cadence regression test.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Abort in-flight refreshes and ignore late completions from disposed effects so old project fetches cannot re-arm timers or reset the new project state.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@harsh-batheja harsh-batheja merged commit 4e93bc1 into main Mar 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant