supabase-kt icon indicating copy to clipboard operation
supabase-kt copied to clipboard

[Bug]: "Invalid Refresh Token: Refresh Token Not Found"

Open ujas-superr opened this issue 2 months ago • 2 comments

General Info

  • [x] I checked for similar bug report
  • [x] I am using the latest version
  • [x] I checked the troubleshooting page for similar problems

Version(s)

3.0.0

Kotlin Target(s) and their respective versions

Android 13

What happened? (include your code)

 io.github.jan.supabase.auth.exception.AuthRestException: Invalid Refresh Token: Refresh Token Not Found
io.github.jan.supabase.auth.AuthImpl.checkErrorCodes(AuthImpl.kt:534)
io.github.jan.supabase.auth.AuthImpl.parseErrorResponse(AuthImpl.kt:502)
io.github.jan.supabase.auth.AuthenticatedSupabaseApiKt$authenticatedSupabaseApi$3.invoke(AuthenticatedSupabaseApi.kt:60)
io.github.jan.supabase.auth.AuthenticatedSupabaseApiKt$authenticatedSupabaseApi$3.invoke(AuthenticatedSupabaseApi.kt:60)
io.github.jan.supabase.network.SupabaseApi.rawRequest$suspendImpl(SupabaseApi.kt:25)
io.github.jan.supabase.network.SupabaseApi$rawRequest$1.invokeSuspend(Unknown Source:15)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

Steps To Reproduce (optional)

No particular steps I can provide because this issue happens randomly. The frequency is around weekly once. I am managing the tokens and not auto-refreshing them in order to avoid any edge case where the refresh tokens are reused.

Relevant log output (optional)


ujas-superr avatar Oct 09 '25 06:10 ujas-superr

I am managing the tokens and not auto-refreshing them in order to avoid any edge case where the refresh tokens are reused.

Well I cannot say much about that... I haven't heard about this issue from people using auto refresh. And also what are those edge cases.

Just from the exeception, I cannot say that this is a bug.

jan-tennert avatar Oct 09 '25 19:10 jan-tennert

I think you always have the edge case of a flaky connection while refreshing the token. The default reuse interval is 10 seconds. If you attempt a refresh and the response gets dropped, you have 10 seconds to retry or you'll need to login again. That exception looks like it could be indicative of that sort of issue. Do you have any more information about what was happening before that exception?

sproctor avatar Oct 10 '25 21:10 sproctor