Skip to content

Conversation

@DayuanJiang
Copy link
Owner

Summary

  • Fixed bug where sending a message was adding duplicate entries to diagram history
  • Root cause: DrawIO's load() function internally triggers an export event, which was being treated the same as user-initiated exports
  • Added expectHistoryExportRef flag to track user-initiated exports and only add to history when explicitly requested

Test plan

  • Send a message and verify only one history entry is added
  • Verify history dialog shows correct number of versions
  • Verify restoring from history still works correctly

When sending a message, the history was being added twice because:
1. handleExport() triggers exportDiagram() which adds to history
2. AI responds and loadDiagram() is called, which internally triggers
   another export event in DrawIO, adding a duplicate entry

Added expectHistoryExportRef flag to track user-initiated exports and
only add to history when the export was explicitly requested.
@vercel
Copy link

vercel bot commented Dec 3, 2025

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

Project Deployment Preview Comments Updated (UTC)
next-ai-draw-io Building Building Preview Comment Dec 3, 2025 4:53am

@DayuanJiang DayuanJiang merged commit 443a937 into main Dec 3, 2025
2 of 4 checks passed
@DayuanJiang DayuanJiang deleted the fix/duplicate-history-entries branch December 3, 2025 04:53
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