Skip to content

Fix: Debounce dashboard loads and cap initial sync processing#623

Draft
9chait9 wants to merge 1 commit into
rohitg00:mainfrom
9chait9:fix/issue-609-f7x1z2
Draft

Fix: Debounce dashboard loads and cap initial sync processing#623
9chait9 wants to merge 1 commit into
rohitg00:mainfrom
9chait9:fix/issue-609-f7x1z2

Conversation

@9chait9
Copy link
Copy Markdown

@9chait9 9chait9 commented May 24, 2026

Fixes #609

This PR addresses the viewer dashboard freezing issue (Issue #609) by implementing several performance enhancements to src/viewer/index.html:

  • Debounced Dashboard Loading: loadDashboard() calls are now debounced, preventing excessive reloads when multiple rapid updates occur (e.g., during a large WebSocket sync event). This coalesces multiple calls into a single update after a 300ms delay.
  • In-flight Load Guard: A mechanism is introduced to ensure only one loadDashboard() operation is in progress at a time, preventing race conditions and redundant data fetches.
  • Initial Sync Capping: The WebSocket sync message handler now explicitly skips per-item processing of large historical data payloads for the dashboard tab during the initial connection. This prevents the dashboard from attempting to render thousands of observations individually, which previously led to browser freezing and high memory consumption. A single debounced dashboard load will still occur after the initial sync to reflect the current state.

These changes significantly improve the viewer dashboard's responsiveness and stability, especially when dealing with large agent memory backlogs.

Addresses issue rohitg00#609 by implementing the following changes to src/viewer/index.html:

- Introduced a debouncing mechanism for loadDashboard() calls to prevent excessive reloads during rapid updates, coalescing multiple calls into a single one after a short delay.
- Implemented an in-flight guard to prevent multiple concurrent loadDashboard() executions.
- Modified the WebSocket 'sync' message handling to ignore per-item processing of large initial sync payloads for the dashboard tab, preventing browser freezing and resource exhaustion. A single debounced dashboard load will now be triggered after the initial sync.

These changes significantly improve the viewer dashboard's performance and responsiveness, especially when dealing with large historical data backlogs.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

@9chait9 is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 24, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 12dd5deb-665e-432b-89b9-01b1fdd70c02

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Viewer dashboard can freeze Chrome by processing large mem-live sync backlogs

1 participant