Repository navigation
Conversation
Compress now forces the next backup pass to be a full checkpoint, publishes it, then frees what it replaced. Discard history does the same and also frees the undo window, behind a confirmation dialog. Free-up never runs if the checkpoint did not land. The forced pass reuses the exporter's "no anchor in the vault" input, so cursors and lane state are unchanged.
A checkpoint still holds each resource's whole Loro history, so the old copy about keeping only the current state over-promised. Discard history removes older copies, the delta chain and the undo window.
"Download backup" saves the drive's sealed vault objects as one .atomic-vault file (versioned header, then the objects in listing order, each with a SHA-256). "Restore from file" validates it and feeds the objects through the same import as a cloud restore, which now takes an injectable object source. Nothing is uploaded; the file stays sealed and needs the drive key.
Member
Author
|
Complexity review (about 1,000 lines of production code, the rest
Good: Generated by Claude Code |
Member
Author
|
Landed in develop through the batch #2210 (squash f39e460), tested together on Mancave run 5204. Generated by Claude Code |
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.
Requested by Joep · project thread
Stacked on #2199 (Loro deltas in signed commits); retarget to
developonce that merges.Before: the Cloud Vault panel could only "Free up space" (prune what the retention rules already allow). A user could not compact the backup on demand, could not drop the undo window together with the old chain, and could not take the backup to their own device.
After: the panel has a "Backup history" block with Compress now (writes one fresh checkpoint, then frees the old chain) and Discard history (same, then also frees the undo window, behind a confirmation that names the space gained). There are also Download backup, which writes one sealed
.atomic-vaultfile, and Restore from file.What it does: the forced checkpoint reuses the exporter's existing "no anchor means checkpoint" path, so cursors, lane state and coverage are unchanged, and free-up never runs unless the checkpoint pass succeeded. The file stays sealed under the drive key, is validated on read (magic, version, truncation, per-object hash, drive and key epoch), and restores through the same
restoreDriveimport path with an injectable object source.How:
backupDrive({ forceCheckpoint })andcompactVaultBackup()inhelpers/managed/vault.ts; newhelpers/managed/vaultFile.ts; UI incomponents/Vault/VaultStorage.tsxandVaultPanel.tsx; strings in the four.pofiles.Known limits: Discard history removes older copies, the delta chain and the undo window but the newest snapshot keeps its own edit history (a true current-state-only backup needs a shallow snapshot, a separate follow-up). Restore still holds all objects in memory. File restore only works for an enrolled drive. The panel has only been rendered standalone with mocked data, not against a live atomic-saas, and the save-file picker was only tested through a mock. Screenshots are in the project thread.
Tests run locally: vitest for vault, vaultFile, useVaultBackup and the Vault components (90 passed), a new Rust test for a forced checkpoint restoring alone, tsc, lint and clippy clean. CI has not run.
Generated by Claude Code