After a recent PR, the draft bundle commit service started behaving unstably when final writes fail. A review of the changes is needed to find defects that break the lifecycle of temporary resources and cause the service state to diverge from the actual result of the operation.
commit_bundle method accepts the path to a temporary draft file and the text of the final content.trim().*.final file must be written;committed counter must increase by 1.committed counter must not change.cargo test
*.final and cleaning up the temporary file.1.85.02021cargo teststd::fs::set_permissions; the write-error scenario is reproducible without platform-specific crates"{draft_path}.final"Use line comments to explain the problem, its impact, the fix and how to test it.