If RelayHook (or any webhook relay / request-response proxy) mixes up responses when two calls happen at the same time, the fix is almost always the same: create a unique request ID for every inbound request and carry it through every hop until you send the response back. In practice, that means generating a UUID, storing it with the request context, and refusing to "guess" which browser tab/session should receive a response.
Photo by Ilya Pavlov on Unsplash
What's happening (the bug pattern)
When a relay tool is doing synchronous request/response handling in a browser (or a browser-adjacent runtime), concurrent requests can collide in ways that look like:
Request A comes in on Tab 1, Request B comes in on Tab 2
The relay processes both concurrently
The response intended for Request A gets delivered to Tab 2 (or vice versa)
This is typically caused by one of these implementation issues:
Shared global state (e.g., "current response handler") that gets overwritten by the second request
Tab/session reuse where multiple calls are being mapped to the same "active tab" context
Race conditions in async code, where "the last listener wins"
Missing correlation key between the inbound request and the outbound response
The practical fix: UUID per request (and thread it everywhere)
Step 1: Generate a request ID at the edge
The moment the request enters your system, assign it a unique ID.
Prefer UUIDv4 (random) unless you have an existing deterministic ID from the upstream provider.
Treat this as a correlation ID for the whole lifecycle.
Example (pseudo-code):
requestId = uuid()
Step 2: Attach the ID to the request context
Store it in the same structure you use to track the call, for example:
in-memory map keyed by requestId
per-tab or per-session store (but still keyed by requestId)
persisted store if you need recoverability
The key requirement: never use "tab" alone as the identifier when more than one request can be in-flight.
Step 3: Propagate the request ID through every hop
If you're seeing weird concurrency behavior in RelayHook (or any webhook relay) and want a clean, testable pattern for correlation IDs + response routing, book a free consulting call — we can help you design and implement it.
Zapier’s DocuSign trigger returns envelope metadata, not W‑9 field values. Why it happens, how to confirm it, and three fixes to get your data into HubSpot.
Sync BlueWatch bookings, inventory, and CRM data into Notion using Zapier webhooks or Make. Step-by-step integration guide for surf schools and tour operators.
Learn how to sync GiveButter donations to Salesforce Nonprofit Cloud via Zapier. Covers field mapping, donor matching rules, and recurring gift troubleshooting.