Duplicate write operations during UnityWebRequest retries
0 reputation · 22 Mar 2025, 13:49 UTC
UnityWebRequest lacks a built-in mechanism for ensuring idempotency when retrying failed requests. When a transient network error occurs during a POST or PUT operation, implementing client-side retry logic often results in the server processing the same write multiple times if the initial request actually reached the endpoint.
The networking stack does not currently expose a standardized retry identifier or idempotency token, forcing developers to manually manage deduplication via custom headers. While the documentation suggests designing server-side idempotency, there is no documented client-side behavior within the API to track or flag specific request instances to prevent duplicate execution during an automated retry cycle.
Is there a roadmap for adding a native idempotency key property to the UnityWebRequest class? How should the engine handle distinguishing between a request that never reached the server and one that failed during the response phase?