The Claim Row Stopped the Duplicate. My Agent Sent the Payment Twice Anyway.
Yesterday I fixed my webhook duplicates with one claimable row per delivery key. A slow receiver took 2.5 seconds to answer, my sweeper ticked every second, and the same payment went out three times before the first acknowledgement landed. One row in a table, claimed atomically, and three deliveries became one. I wrote it up feeling pleased with myself. Then rudratosh left a comment that undid…
Yesterday, the author resolved webhook duplicates by using one claimable row per delivery key. However, a slow receiver caused three payments to be sent before the first acknowledgment arrived. The fix involved claiming a row atomically, turning three deliveries into one. The author wrote up the solution, feeling pleased but then received a comment that revealed an issue: the claim row stops the resend, but the agent still believes the step failed.
The author ran the fix twice to examine the impact of this belief, discovering that the planner did not see the claim row. The first run saw the planner read the claim row before planning, leading to a single delivery and no duplicate payments. The second run did not, resulting in two deliveries and a duplicate payment. The key difference was one read of the claim row.
The author argues that informing the planner about the step's success is crucial, as the planner's belief remains outdated unless it revisits the information. Additionally, a log line indicating the acknowledgment was written but unobserved by the planner highlights the importance of feedback in the system. Finally, the author notes that re-running the step with a new key does not save from the issue, as the claim row cannot prevent a duplicate payment if the planner believes it was never made. The only safe step for the quiet fix is one without a downstream step.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.