@supabase/auth-js 2.110.7 → 2.110.8-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supabase/auth-js",
3
- "version": "2.110.7",
3
+ "version": "2.110.8-canary.1",
4
4
  "private": false,
5
5
  "description": "Official SDK for Supabase Auth",
6
6
  "keywords": [
@@ -4290,7 +4290,10 @@ export default class GoTrueClient {
4290
4290
  } catch (err) {
4291
4291
  await this.stateChangeEmitters.get(id)?.callback('INITIAL_SESSION', null)
4292
4292
  this._debug('INITIAL_SESSION', 'callback id', id, 'error', err)
4293
- if (isAuthSessionMissingError(err)) {
4293
+ if (isAuthSessionMissingError(err) || isAuthRetryableFetchError(err)) {
4294
+ // A missing session or a transient/aborted network failure (e.g. a
4295
+ // superseded page navigation cancelling the in-flight request) is
4296
+ // not an application error — warn rather than surface it raw.
4294
4297
  console.warn(err)
4295
4298
  } else {
4296
4299
  console.error(err)
@@ -4866,7 +4869,15 @@ export default class GoTrueClient {
4866
4869
  } catch (err) {
4867
4870
  this._debug(debugName, 'error', err)
4868
4871
 
4869
- console.error(err)
4872
+ if (isAuthRetryableFetchError(err)) {
4873
+ // Transient/aborted network failure during session recovery (e.g. a
4874
+ // superseded page navigation cancelling the in-flight request). Warn
4875
+ // rather than surface it raw; the session is untouched and recovery
4876
+ // will run again on the next load.
4877
+ console.warn(err)
4878
+ } else {
4879
+ console.error(err)
4880
+ }
4870
4881
  return
4871
4882
  } finally {
4872
4883
  this._debug(debugName, 'end')
package/src/lib/fetch.ts CHANGED
@@ -224,9 +224,10 @@ async function _handleRequest(
224
224
  ...requestParams,
225
225
  })
226
226
  } catch (e) {
227
- console.error(e)
228
-
229
- // fetch failed, likely due to a network or CORS error
227
+ // fetch failed (network / CORS / aborted request) — surfaced to the
228
+ // caller as a retryable error below. Deliberately not logged here: an
229
+ // aborted in-flight request (e.g. a superseded page navigation) is a
230
+ // transient condition, and logging the raw error pollutes the console.
230
231
  throw new AuthRetryableFetchError(_getErrorMessage(e), 0)
231
232
  }
232
233
 
@@ -4,4 +4,4 @@
4
4
  // - Debugging and support (identifying which version is running)
5
5
  // - Telemetry and logging (version reporting in errors/analytics)
6
6
  // - Ensuring build artifacts match the published package version
7
- export const version = '2.110.7'
7
+ export const version = '2.110.8-canary.1'