Add withRetry utility and retry user upsert on transient failures#922
Add withRetry utility and retry user upsert on transient failures#922
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
There was a problem hiding this comment.
I added this so we can use it in places where we just need retires without the cache logic. We could have done this with react query fetchQuery (how it was before this change in cashu-receive-quote-hooks file where we had queryKey: ['check-mint-quote', receiveQuote.quoteId],) but if we do those we have these temp cache entries (we have to have some query key, gcTime and staleTime 0) which is a bit awkward
9dc12cf to
ca39dad
Compare
ca39dad to
2f66233
Compare
Fixes AGICASH-7D Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2f66233 to
6c04b0e
Compare
Summary
withRetryutility (app/lib/with-retry.ts) with exponential backoff (500ms, 1s, 2s, ... capped at 30s), configurable retry count or predicate, custom retry delay function, and abort signal support_protected.tsxmiddleware withwithRetryto handle transient network failures (fixes AGICASH-7D)fetchQuerywithwithRetryfor mint quote check incashu-receive-quote-hooks.tsuserQueryOptionsinuser-hooks.tsxTest plan
Resolves https://make-prisms.sentry.io/issues/7310936806/?alert_rule_id=16176971&alert_type=issue&environment=production¬ification_uuid=1f60e2dd-cfdf-49e3-867a-8b566da31fca&project=4509707316690944&referrer=discord