fix(sync): preserve omitted targets when any document is refused - #7
Closed
albertovincenzi wants to merge 1 commit into
Closed
fix(sync): preserve omitted targets when any document is refused#7albertovincenzi wants to merge 1 commit into
albertovincenzi wants to merge 1 commit into
Conversation
albertovincenzi
added a commit
that referenced
this pull request
Sep 5, 2026
The regression declared one target and then synced a list naming only an invalid document. That proves the reap did not run, but not the property the change is about: a list that is partly valid is still not authority to delete what it leaves out. Two targets now, and the submitted list carries one valid document plus one broken one. `keep` is applied, `broken` is refused, and `drop` — the target nobody named — is still declared and still running. Taken from #7, which fixes the same bug with a byte-identical change to `do_sync` and can be closed once this lands. Claude-Session: https://claude.ai/code/session_012K8u7BEJyd6nDNMCQAgH3z
Collaborator
Author
|
Closing as a duplicate of #29. The two branches make a byte-identical change to #29 is the one to keep, because #46 is stacked on it. The stronger regression from this PR has been ported there: #29's test now declares two targets, submits one valid document plus one broken one, and asserts that the omitted target survives, which is the property neither test covered before. |
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.
Problem
The target sync endpoint kept processing after a document was refused and then always entered its destructive reap phase. A partially invalid desired-state list could therefore return
ok: falsewhile deleting an existing one-node graph omitted from the request.Fix
Review notes for Alice
This PR intentionally changes only the boundary between declaration and deletion. It does not attempt a distributed transaction across the valid declarations or broker-backed store. The safety invariant is narrower and explicit: validation/provisioning refusal means zero reap operations.
Verification
cargo test --workspacecargo clippy -p gate-server --all-targets -- -D warningscargo fmt --all -- --checkThe end-to-end regression follows the existing live-test convention and requires
GATE_TEST_QUEEN_URL.