]> git.kaiwu.me - haproxy.git/commit
DEV: patchbot: don't pretend a save succeeded when the server ignored it
authorWilly Tarreau <w@1wt.eu>
Mon, 6 Jul 2026 17:17:48 +0000 (19:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2026 12:45:32 +0000 (14:45 +0200)
commit351c7e6598e47933a005e625f38b16dcd2fb4ddc
tree5d169c07648c329e6371fa823da4ffaee70a931e
parentf583269db92fea01d52e2094fbafa49f8a981ae7
DEV: patchbot: don't pretend a save succeeded when the server ignored it

The save handler treated any HTTP 200 as a full success and advanced
the local reference for everything it had sent, only special-casing the
reported conflicts. But the server legitimately drops directives it
cannot parse, and answers "OK <n> directives applied" with what it
really did. The typical case is an outdated update scripton the server
which ignores the whole "setnotes" directive, applies nothing, and
the client still displayed the edit as saved... until the next "Get
updates" reverted it.

Let's count the directives sent, and when the server's applied count
plus the reported conflicts don't add up, believe the server, not
ourselves: advance nothing, keep every edit local (boxes open, save
button lit) and tell the user how many changes were ignored,
suggesting a version mismatch.
dev/patchbot/scripts/post-ai.sh