This is really interesting! I haven't worked with WebMCP much yet, but losing a response mid-update sounds so frustrating. Thanks for sharing how you recovered it, this will definitely help beginners like me. Did it happen only once or is it a common issue?
Staff Software Engineer @ Navan, ML Flow & Cypress Ambassador, Docker Captain and creator of agent-inspect, writing about production AI agents, TypeScript, observability, testing, and developer tools.
@rohail_rohail_422ad9a1155 Good question. This was one deliberately injected lost response, not a production incident. The same uncertainty can happen with an ordinary network timeout after a server commits. The command ID and receipt lookup let the client check the original update before it considers another write.
Staff Software Engineer @ Navan, ML Flow & Cypress Ambassador, Docker Captain and creator of agent-inspect, writing about production AI agents, TypeScript, observability, testing, and developer tools.
@vmodal_ai If you try WebMCP in your workflow, I'd start with one read-only tool, then test a mutation where the server commits but the browser loses the response. A stable command ID and read-only recheck path let the app recover without repeating the write or erasing unsaved form edits. What workflow are you considering?
Solo developer building practical CLI tools for Linux auditing and B2B data extraction. Creator of Vaultcheck and NPILift. I write about silent failures, false green lights, and infrastructure reliabi
You close the hole at the API and reopen it at the storage layer: if the receipt row is written in a second statement after the PATCH commits, a crash in between leaves revision 3 committed with nothing to look up, and your client reads that 404 as "never applied" and retries into a double apply. Insert the receipt inside the same transaction as the revision bump, and make the lookup answer with a terminal row or 410 Gone instead of 404, with retention at least as long as your max client retry window - 24h of receipt rows is cheaper than one reconciliation job.
Staff Software Engineer @ Navan, ML Flow & Cypress Ambassador, Docker Captain and creator of agent-inspect, writing about production AI agents, TypeScript, observability, testing, and developer tools.
@dafili You are right to press on the storage boundary. “Same server-side workflow” is not enough evidence that the revision update and receipt insert commit atomically; the crash-between-statements case needs its own test. A missing receipt must remain ambiguous, including after retention expires, rather than authorize a replay. I would make expiry explicit in the lookup and require reconciliation against authoritative state before another write.
Solo developer building practical CLI tools for Linux auditing and B2B data extraction. Creator of Vaultcheck and NPILift. I write about silent failures, false green lights, and infrastructure reliabi
Agreed on making expiry explicit, and I'd push it to three outcomes rather than two: receipt present, unknown-expired, absent — only absent may proceed to a write, otherwise retention expiry quietly becomes the replay path you just closed. The test I'd write for the crash window is SELECT pg_terminate_backend(pg_backend_pid()) right after the revision UPDATE and before the receipt INSERT, then retry the same key and assert it returns the stored revision with zero new writes. If clients need the ambiguity visible, return that stored revision with a reconciled=false flag instead of a 409.
The 'unknown, not failed' distinction is exactly the right frame: a dropped 200 after commit leaves the client unable to claim either outcome, so replaying the write without an idempotency key risks double-applying the mutation. The recovery path you chose — a read-back against the stable command ID and expected revision instead of another PATCH — keeps the operation idempotent and lets the UI reconcile from server state rather than guess. In a desktop/Electron-style app the same pattern applies to IPC writes to the main process: persist an outbound command with its own id, and on reconnect or reload reconcile by reading current state before re-sending, rather than assuming a lost reply means a lost action.
Staff Software Engineer @ Navan, ML Flow & Cypress Ambassador, Docker Captain and creator of agent-inspect, writing about production AI agents, TypeScript, observability, testing, and developer tools.
@mp3sss31 The IPC comparison is useful. Across a renderer reload, I would persist the original command ID together with its draft ID and intended revision, then query the main process for that command before considering any resend. A local “request timed out” flag is only evidence about the reply path; it says nothing about whether the write landed.
Product leader and systems analyst in fintech and edtech. Founder of AnalystCraft. Writing about requirements, acceptance criteria, agent evaluation, and Test-Driven Product Development.
The separation between the saved server state and the person’s newer unsaved edit is particularly useful. What happens if the command receipt has expired before the client reconnects? A missing receipt would not prove the write failed, so I’d keep the result unresolved and avoid a fresh mutation until a person or an independent record can reconcile it. Does the interface expose that boundary explicitly?
Staff Software Engineer @ Navan, ML Flow & Cypress Ambassador, Docker Captain and creator of agent-inspect, writing about production AI agents, TypeScript, observability, testing, and developer tools.
@innokentyb Yes. In the tested path, an unavailable lookup leaves the editor at OUTCOME_UNKNOWN and blocks a fresh mutation. Receipt expiry is a separate case the demo has not exercised. I would show it as “reconciliation required,” keep the unsaved human edit visible, and avoid treating a missing receipt as proof of failure. An explicit expired result would help the UI distinguish that from a receipt that has not appeared yet.
We're a place where coders share, stay up-to-date and grow their careers.
This is really interesting! I haven't worked with WebMCP much yet, but losing a response mid-update sounds so frustrating. Thanks for sharing how you recovered it, this will definitely help beginners like me. Did it happen only once or is it a common issue?
@rohail_rohail_422ad9a1155 Good question. This was one deliberately injected lost response, not a production incident. The same uncertainty can happen with an ordinary network timeout after a server commits. The command ID and receipt lookup let the client check the original update before it considers another write.
looks good , we will try to integrate webMCP
@vmodal_ai If you try WebMCP in your workflow, I'd start with one read-only tool, then test a mutation where the server commits but the browser loses the response. A stable command ID and read-only recheck path let the app recover without repeating the write or erasing unsaved form edits. What workflow are you considering?
You close the hole at the API and reopen it at the storage layer: if the receipt row is written in a second statement after the PATCH commits, a crash in between leaves revision 3 committed with nothing to look up, and your client reads that 404 as "never applied" and retries into a double apply. Insert the receipt inside the same transaction as the revision bump, and make the lookup answer with a terminal row or 410 Gone instead of 404, with retention at least as long as your max client retry window - 24h of receipt rows is cheaper than one reconciliation job.
@dafili You are right to press on the storage boundary. “Same server-side workflow” is not enough evidence that the revision update and receipt insert commit atomically; the crash-between-statements case needs its own test. A missing receipt must remain ambiguous, including after retention expires, rather than authorize a replay. I would make expiry explicit in the lookup and require reconciliation against authoritative state before another write.
Agreed on making expiry explicit, and I'd push it to three outcomes rather than two: receipt present, unknown-expired, absent — only absent may proceed to a write, otherwise retention expiry quietly becomes the replay path you just closed. The test I'd write for the crash window is
SELECT pg_terminate_backend(pg_backend_pid())right after the revision UPDATE and before the receipt INSERT, then retry the same key and assert it returns the stored revision with zero new writes. If clients need the ambiguity visible, return that stored revision with a reconciled=false flag instead of a 409.The 'unknown, not failed' distinction is exactly the right frame: a dropped 200 after commit leaves the client unable to claim either outcome, so replaying the write without an idempotency key risks double-applying the mutation. The recovery path you chose — a read-back against the stable command ID and expected revision instead of another PATCH — keeps the operation idempotent and lets the UI reconcile from server state rather than guess. In a desktop/Electron-style app the same pattern applies to IPC writes to the main process: persist an outbound command with its own id, and on reconnect or reload reconcile by reading current state before re-sending, rather than assuming a lost reply means a lost action.
@mp3sss31 The IPC comparison is useful. Across a renderer reload, I would persist the original command ID together with its draft ID and intended revision, then query the main process for that command before considering any resend. A local “request timed out” flag is only evidence about the reply path; it says nothing about whether the write landed.
The separation between the saved server state and the person’s newer unsaved edit is particularly useful. What happens if the command receipt has expired before the client reconnects? A missing receipt would not prove the write failed, so I’d keep the result unresolved and avoid a fresh mutation until a person or an independent record can reconcile it. Does the interface expose that boundary explicitly?
@innokentyb Yes. In the tested path, an unavailable lookup leaves the editor at OUTCOME_UNKNOWN and blocks a fresh mutation. Receipt expiry is a separate case the demo has not exercised. I would show it as “reconciliation required,” keep the unsaved human edit visible, and avoid treating a missing receipt as proof of failure. An explicit expired result would help the UI distinguish that from a receipt that has not appeared yet.