Repository navigation
fix: stop repeated .univer backups on Windows - #57
Merged
Merged
Conversation
libsql keeps the database locked after close on Windows, so an in-process rename fails and the next open leaves another backup. Migrate in a helper process, then replace the original after it exits, and reuse a same-byte backup when that open is retried. Co-authored-by: Cursor <cursoragent@cursor.com>
The bundled helper and its subprocess migrations exceed Vitest's default 5s limit on the Linux runner. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
.univerfile locked afterclose(), so the in-process upgrade rename fails and the original stays on the old format.dist/upgrade-worker.js. The parent replaces the original only after that process exits.Test plan
pnpm --filter @univer/univerfile-sqlite testpnpm --filter @univer/univerfile-sqlite typechecknode apps/cli/scripts/build.mjsemitsdist/upgrade-worker.js, andnode apps/cli/dist/bin.js --helpstill starts the CLI.univerfile and confirm only one*.backup-*appears and the file opensMade with Cursor