Skip to content

Conversation

@ngafar
Copy link
Collaborator

@ngafar ngafar commented Jan 14, 2026

Description

Fixing this (low severity) issue that bug bot picked up:

The cleanup effect in useDebouncedNotebookUpdate has an empty dependency array, so it only clears pending timeouts on unmount. When chartData changes (user switches to a different chart), pending debounced updates aren't cleared. The scheduled timeout still captures the old updateNotebookCell callback, which references the previous chartData.cellId. This can cause the previous chart's cell to be unexpectedly updated after the user has already switched to viewing a different chart.

Testing

  1. Open Chart Wizard with a chart
  2. Make a change that triggers a debounced update
  3. Quickly switch to a different chart before the debounce completes
  4. Verify the previous chart's cell is not updated
  5. Make changes to the new chart and verify they work correctly

Documentation

N/A


Note

Fix: debounce cleanup in useDebouncedNotebookUpdate

  • Update cleanup effect to depend on chartData (from [] to [chartData]) so pending timeouts are cleared on chart switches.
  • Prevents stale debounced updateNotebookCell executions from affecting previously selected chart cells.

Written by Cursor Bugbot for commit 6994a6c. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Jan 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
monorepo Ready Ready Preview, Comment Jan 14, 2026 6:38pm

@ngafar ngafar requested a review from aarondr77 January 14, 2026 19:30
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.

2 participants