fix(drive,docs): build request before the lease gate - #1713
Merged
Merged
Conversation
gate_leased_write fsyncs a write-ahead pending audit record (ADR-0080 §11) and only the mutating call's own allowed/failed outcome concludes it. format.rs and structure.rs built their batchUpdate request after the gate, so a request that could never be issued (a malformed color, a sheet that resolved by title but reported no sheetId) still opened a pending record with nothing to close it — indistinguishable from a process that died mid-write. Move build_request above the gate in both engines, matching protection.rs's existing ordering. One accepted side effect: a malformed request under a bad or absent lease now reports the request-build refusal rather than the lease refusal, consistent with every other pre-lease refusal both engines already report ahead of the gate. Fixes #1688
CoverageTotal: 97.27% ⚪ 0 pp vs Comparing No per-file coverage changes vs 🔇 5 ignored region(s), 0 tolerated region(s)
Patch coveragePatch: 100% (50/50 new lines covered)
|
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
drive sheets format-cells/update-borders/etc. and thestructureverbs no longer orphan apendingaudit record when building the request fails after the lease gate — both engines now build the request before the gate, matchingprotection.rs's existing shape.Test plan
cargo buildcargo test --lib drive::sheets::(485 passed)cargo clippy --all-targets -- -D warnings/code-review high— no correctness bugs found; two minor cleanup findings noted but left as-is (comment duplication, and a documented-only ordering contract) since neither is a bug