Add safe macOS archive migration and native windows - #103
Open
LeonidasZhak wants to merge 1 commit into
Open
Conversation
LeonidasZhak
marked this pull request as ready for review
July 29, 2026 11:40
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
Why
The previous frameless window flag removed normal macOS window controls. The first archive prototype also persisted a growing JSON manifest after every item. At tens of thousands of records this creates substantial write amplification, and an out-of-space error can interrupt the state transition around cleanup.
This PR moves state to SQLite/WAL with
FULLsynchronous transactions. Each item recordsarchivingandremovingbefore the external file operation, so an interrupted run can be reconciled conservatively on restart.Archive and cleanup safety model
fsync, verify SHA-256, and organize one bounded batch. Source files remain unchanged.send2trash.Additional guards:
ready_to_removeentries require the new verification path before cleanupunknown_conversationUser-visible changes
Verification
python -m unittest discover -s tests -v— 31 tests passedruff checkfor the new archive module and tests; focused undefined-name/syntax lint formain.pypython -m py_compile main.py utils/archiveMigration.py utils/selectVersion.pyPRAGMA integrity_check = ok.tmprewrites.appbuild with Python 3.13.12codesign --verify --deep --strictpassed; packaged entitlements were inspectedHOMElaunch smoke with empty stderr and no crash tracebackgit diff --checkValidation boundary
The final test pass did not upload files to a real iCloud account or touch a real WeChat directory. iCloud state transitions are covered with deterministic status fixtures, while the packaged app, Foundation bridge, signing, and isolated launch were validated locally.
Related context
This builds on the upstream macOS startup work in
3f4a429.