T
TanStack2mo ago
wise-white

Retry next in middleware

Hey! so just saw we now have the ability to access the router instance (and thus the root context) from a client function middleware, which is awesome, thank you!! This reminded me of the other QoL feature regarding middlewares I'd love to see: retrying the next() handler. My use case is to add retry logic for certain kinds of errors (in my case on the client, but it'd apply on the server too) that is encapsulated in the server fn, without having to move that logic up to say the query client. Currently, it seems calling next multiple times doesn't work, the successive calls just return undefined
2 Replies
wise-white
wise-white2mo ago
can you please create a github issue for this? ideally also add a failing e2e test to the server-functions e2e project via a PR
wise-white
wise-whiteOP2mo ago
Sure thing, added it here
GitHub
Cannot call next multiple times on server function middleware · ...
Which project does this relate to? Start Describe the bug Calling next multiple times on a server function middleware (both client and server) does not work as expected. The additional calls just r...

Did you find this page helpful?