← Forward Deployed Engineer
Forward Deployed Engineer

Case Study: A Bug That Could Have Posted the Same Thing Twice

5 Nov 2026·4 min read

This series has talked about debugging someone else's infrastructure in the abstract. This part is the opposite: a real bug, in a real system, that is still running right now — the scheduler that posts this very series to LinkedIn every weekday.

The problem

The scheduler calls LinkedIn's API once a day to publish the next queued post. If that network call times out, or comes back with no clear answer, there is a real ambiguity: LinkedIn may have already published the post and only the confirmation was lost. A naive retry in that situation risks posting the exact same thing twice.

Why it happens

A failed network call only tells you that YOUR side did not receive a clear answer — it tells you nothing about whether the other side actually processed the request. Code that treats "no response" the same as "definitely failed" will retry something that may have already succeeded.

The fix

On an unclear failure, the scheduler does not guess. It parks the row as failed with its retries spent, and sends an alert asking a human to check LinkedIn directly before anything retries automatically. The system's job stops at "I do not know" — it does not pretend to know.

Do this in 60 secondsFind one place in code you own that retries automatically after any network call — an API request, a webhook delivery, a payment call. Read the retry condition closely and ask: if that call actually succeeded on the other side but the response never arrived at your side, what does the retry do? If the honest answer is "it would run again," you have found a double-post bug waiting to happen. Write down, in one sentence, what the fix would need to check before retrying.
Today’s AI angleAI agents that call tools automatically hit this exact ambiguity constantly — a tool call times out, and the agent has to decide whether to retry. An agent that always retries blindly can double-charge a payment or double-send a message just as easily as the scheduler in this story could.
Interview prepHow would you design a retry system that cannot accidentally duplicate an action? Separate "did my request reach the server" from "did the server actually complete the action" as two distinct unknowns. Use an idempotency key so a retried request is safe even if it does land twice, and when the outcome is genuinely unclear, fail into a state a human can check rather than guessing by retrying.
Case Study: A Bug That Could Have Posted the Same Thing Twice · Ali Huzaifa