You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
retryLink over wsLink: a retried request is never sent, so it hangs #7886
🤖 With retryLink in front of wsLink and the default retryDelayMs (0), a retry never reaches the server. A retried query's promise never settles. A retried subscription stops after the error and never resumes, and onError and onComplete are never called.
constt=initTRPC.create();letcalls=0;constrouter=t.router({flaky: t.procedure.query(()=>{if(++calls===1)thrownewTRPCError({code: 'INTERNAL_SERVER_ERROR'});return'ok';}),});// ...serve `router` with applyWSSHandler...constclient=createTRPCClient<typeofrouter>({links: [retryLink({retry: (opts)=>opts.attempts<3}),wsLink({client: createWSClient({ url })}),],});awaitclient.flaky.query();// never settles; the server is called once
Expected: the retry is sent. The query resolves 'ok', and a subscription resumes from its last event id.
Actual: nothing more is sent after the first error. With retryDelayMs: () => 10 it works.
Root cause:retryLink retries synchronously with the same op.id, so the retry is registered while the failed request is still being cleaned up. That cleanup deletes requests by id (requestManager.ts:79 via wsClient.ts:234, and again at wsClient.ts:419), which also removes the retry before it is sent.
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.
Activity
fix(client): send a wsLink request that retryLink retries with the sa…
github-actions commentedon Nov 5, 2026
This issue has been locked because we are very unlikely to see comments on closed issues. If you are running into a similar issue, please create a new issue. Thank you.