Commit Graph
3 Commits
Author SHA1 Message Date
Nicholai 2992bf6d36 fix(tools): publish blank-body files atomically 2026-10-01 20:18:33 -06:00
Nicholai 3a125dcce5 fix(tools): close empty-write races and preserve clears 2026-10-01 20:18:33 -06:00
Aashish 9056bac95b fix(tools): refuse an empty write_file body that would truncate a file
The handler opened the target in "w" mode without looking at the body, so a
call whose content section was lost by a parser cut the file to 0 bytes and
still answered exit_code=0 (#6414). Gate the truncating open on the size the
file has on disk — the read just above it answers "" for bytes it cannot
decode, so an undecodable target would otherwise look empty — and let only an
inline-JSON content key that is literally an empty string declare the clear.

Also stop turning a null content into the four characters "None", which could
be neither refused as a lost body nor honoured as an empty write.
2026-10-01 20:18:33 -06:00