-
-
Notifications
You must be signed in to change notification settings - Fork 185
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
- I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
It keeps trying to refresh the token when the server is unavailable. I can't get it to stop and show an error.
Lines 1836 to 1859 in daa2669
return await retryable( | |
async (attempt) => { | |
if (attempt > 0) { | |
await sleep(200 * Math.pow(2, attempt - 1)) // 200, 400, 800, ... | |
} | |
this._debug(debugName, 'refreshing attempt', attempt) | |
return await _request(this.fetch, 'POST', `${this.url}/token?grant_type=refresh_token`, { | |
body: { refresh_token: refreshToken }, | |
headers: this.headers, | |
xform: _sessionResponse, | |
}) | |
}, | |
(attempt, error) => { | |
const nextBackOffInterval = 200 * Math.pow(2, attempt) | |
return ( | |
error && | |
isAuthRetryableFetchError(error) && | |
// retryable only if the request can be sent before the backoff overflows the tick duration | |
Date.now() + nextBackOffInterval - startedAt < AUTO_REFRESH_TICK_DURATION_MS | |
) | |
} | |
) |
To Reproduce
- Login to a working project
- Change supabase url to
https://foo.example.com
. simulate a server error
Expected behavior
Stop and throw an error after a certain number of attempts.
System information
- OS: Windows
- Browser (if applies): chrome
- Version of supabase-js: 2.49.1
- Version of Node.js: Bun 1.2.5
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working