Repository navigation
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
|
GitGuardian fails here on incident 37585749, which is not from this PR. The flagged commits (4f6fe33, 49ac330, 1d80224) come from #1767 through the base branch. The hit is a false positive: a test fixture in Generated by Claude Code |
Pins three things the commit row in Tree::Resources is relied on for: a genesis row keeps its signed loroUpdate and still verifies after latest retention drops its envelope, the row blob keeps loroUpdate and is indexed by subject, and a destroy replayed after a re-create is refused because its row is the only record left.
7785c67 to
67880f8
Compare
|
Landed on develop in 4a3a0bf via the combined batch #1852 (green on Mancave). Closing. Generated by Claude Code |
Requested by Joep · project thread
Before: nothing on this branch failed if a stored genesis, rights or destroy commit stopped carrying its own signed payload. The tests that guarded this on an earlier branch never reached this base, and the check that refuses to replay a destroy after the resource is re-created had no test at all.
After: three tests fail as soon as a stored commit depends on its envelope again, or the destroy replay check goes missing. Nothing changes at runtime; this PR only adds tests.
How: in
lib/src/envelopes.rs,stored_genesis_commit_keeps_its_signed_payload_after_a_later_editedits a resource once. The defaultlatestretention then deletes the genesis envelope. The test checks that the genesis commit row still has itsloroUpdateand still verifies, and that the same row withloroUpdateremoved does not.destroy_replay_after_recreate_is_refused_by_the_commit_rowdestroys a resource, has a peer send its genesis again, and checks three things: the destroy envelope is gone, the destroy's commit row is still there, and replaying the destroy is refused with "already applied here". Inlib/src/db/test.rs,commit_resource_blob_keeps_loro_update_and_is_indexed_by_subjectreads the rawTree::Resourcesrows. The commit row keepsloroUpdateand has no Loro snapshot. The resource's own row leavesloroUpdateout. A query onsubjectfinds the commit row. The background is in #1776.Tests:
cargo test -p atomic_lib --features "db,db-sled,ws,iroh,config,rdf,discovery,ring" --lib -- envelopes:: db::test::: 65 passed, 0 failed.Db::apply_commitdisabled by hand, the replay test fails as intended. The check was restored before committing.cargo fmt --all: clean.cargo clippy -p atomic_lib --tests: no warnings in the changed files.