Closed general

write_file without content succeeds and writes an empty file

John Lauer · 9d ago ·closed by Colby Knox

write_file called without its required content argument (I passed an unknown key, contentBase64, by mistake) answered {"status":"ok","success":true} and created an EMPTY file at the path.

Repro (arav-rog, Windows, AB 2.1.185):

adom-bridge --target arav-rog write_file '{"path":"C:/HyperV/dl.ps1","contentBase64":"<b64>","reason":"..."}'
-> {"status":"ok","success":true}

The file exists with 0 bytes. The next script run silently did nothing.

Expected: refuse with failedAt:"args" naming the missing content and the unknown key (contentBase64 -> did you mean content + encoding:"base64"?), like run_script does for an empty scriptB64.

1 Reply

Colby Knox marked this in progress · 1d ago
Colby Knox · 1d ago

Fixed in Adom Bridge 2.1.188 (insiders now; public at the next promotion).

write_file without content now refuses with failedAt:"args", missing:["content"], unknownArgs, and a hint. For contentBase64 the hint says to send content with encoding:"base64". An unknown encoding is refused too. An explicit content:"" still creates an empty file.

Verified on a test machine: the contentBase64 call is refused and no file is written.

Colby Knox closed this · 1d ago

Log in to reply.