Skip to content

fix(updater): add snapshot fallback for source backups - #657

Open
xiami762 wants to merge 1 commit into
devfrom
fix/updater-backup-snapshot-fallback
Open

fix(updater): add snapshot fallback for source backups#657
xiami762 wants to merge 1 commit into
devfrom
fix/updater-backup-snapshot-fallback

Conversation

@xiami762

Copy link
Copy Markdown
Contributor

Summary

  • keep the existing direct tar.gz backup as the primary path
  • fall back to archiving a filtered temporary source snapshot when direct backup fails
  • write backups through a partial file and clean up failed archives and temporary snapshots
  • keep runtime data, Python environments, and Node dependencies out of fallback backups

Root cause

The updater can archive the live source tree while files are changing on Windows. Python tarfile records a file size before reading it, so a file that shrinks during the read can raise unexpected end of data and abort the upgrade.

Tests

  • uv run ruff check flocks/updater/updater.py tests/updater/test_updater.py
  • uv run pytest -q tests/updater/test_updater.py tests/updater/test_restart_handoff.py

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.

1 participant