Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Network error removes session data #141

@dshukertjr

Description

@dshukertjr

Bug report

Describe the bug

By looking at the code here, it seems like whenever user opens the app while offline, the session is deleted.

const { error } = await this._callRefreshToken(currentSession.refresh_token)
if (error) {
  console.log(error.message)
  await this._removeSession()
}

To Reproduce

  1. Create an app using Supabase
  2. Sign in with your favorite method
  3. Turn on air plane mode
  4. Open the app and your are signed out

Expected behavior

Session should not be deleted when offline, and refreshing session should be attempted upon device regaining internet connection.

Additional context

I guess this issue has two challenges that it needs to overcome:

  1. detect network error and in such case, do not remove session (I guess this is pretty easy)
  2. in case the error was a network error, detect when the device becomes online again and retry session recovery

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions