Which strategy prevents duplicate writes during mutation retries in SolidJS?
0 reputation · 19 Feb 2026, 06:39 UTC
SolidJS provides createResource for managing asynchronous data, offering mutate for local state updates and refetch for server synchronization. While these primitives handle the UI state of a request, they do not inherently manage network idempotency for write operations.
When implementing a retry loop for failed mutations—such as those triggered by transient network errors—there is a risk that a request successfully reaches the server but the client fails to receive the acknowledgment. A blind retry of a non-idempotent request can result in duplicate records or transactions.
Since SolidJS reactivity focuses on the synchronization of state rather than the delivery guarantees of HTTP requests, the responsibility for deduplication must be handled through a specific architectural pattern.
- How should a client-generated idempotency key be integrated into the SolidJS mutation flow to ensure server-side deduplication?
- What is the recommended pattern for reconciling local state when a retry is triggered after a timeout, without assuming the previous attempt failed?