Repository navigation
Fix silent loss of changes in enum-only diagrams - #1186
Merged
Merged
Conversation
|
@Thedan-1 is attempting to deploy a commit to the dottle's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I ran into silent loss of enum changes while testing a PostgreSQL schema revision locally on
dc32c8b(Windows, Node 22.14.0, Chromium-based in-app browser, Chinese UI).The workflow was: create an
orderstable, let it save, use Save as to makeorders-v2-test, open that copy, remove its table, then defineorder_statuswith the valuepending. Save as itself worked and the original diagram remained intact. The problem started when the copy contained only enums: the header still said “No changes”, and refreshing removed the enum.The same guard causes the reverse problem: load a saved enum-only diagram, delete its last enum, and refresh. The UI says the enum was deleted, but it returns after reload.
This patch counts enums when deciding whether there is content to autosave and watches their count. It also lets edits recorded in undo/redo history save an empty diagram, so deleting the last object or undoing its creation persists. A fresh, untouched empty canvas still does not trigger autosave.
Local verification
ordersdiagram: its table remained intact.npm run lintandnpm run buildpassed. Build emitted bundle-size and third-party dependency warnings.These are actual browser checks against the running application, not mocked UI or automated unit tests. Screenshots are stored on a separate branch of my fork and are not part of the code diff.
Evidence
Enum entered, but header still shows no changes:

Original code after reload — enum is gone:

Patched code after reload — name and value remain:

Additional deletion-before/after screenshots.