Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after leaving app open #60

Closed
Brotakuu opened this issue Feb 16, 2021 · 2 comments
Closed

Error after leaving app open #60

Brotakuu opened this issue Feb 16, 2021 · 2 comments

Comments

@Brotakuu
Copy link

Each time I leave the app open for a few hours, I come back to this error:

TypeError: undefined is not an object (evaluating 'this.currentSession')
- node_modules/react-native/Libraries/LogBox/LogBox.js:148:8 in registerError
- node_modules/react-native/Libraries/LogBox/LogBox.js:59:8 in errorImpl
- node_modules/react-native/Libraries/LogBox/LogBox.js:33:4 in console.error
- node_modules/expo/build/environment/react-native-logs.fx.js:27:4 in error
- node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
- node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
- node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
- node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:9:32 in ErrorUtils.setGlobalHandler$argument_0
- node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
- node_modules/regenerator-runtime/runtime.js:293:29 in invoke
- node_modules/regenerator-runtime/runtime.js:63:36 in tryCatch
- node_modules/regenerator-runtime/runtime.js:154:27 in invoke
- node_modules/regenerator-runtime/runtime.js:164:18 in PromiseImpl.resolve.then$argument_0
- node_modules/react-native/node_modules/promise/setimmediate/core.js:37:13 in tryCallOne
- node_modules/react-native/node_modules/promise/setimmediate/core.js:123:24 in setImmediate$argument_0
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:130:14 in _callTimer
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:181:14 in _callImmediatesPass
- node_modules/react-native/Libraries/Core/Timers/JSTimers.js:441:30 in callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:387:6 in __callImmediates
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:135:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:134:4 in flushedQueue
* [native code]:null in flushedQueue
* [native code]:null in invokeCallbackAndReturnFlushedQueue

The error comes from SupabaseClient.js

const constants_1 = require("./lib/constants");

Is this a known issue where currentSession times out while the user has the app open. Is there a work around?

@kiwicopple
Copy link
Member

I suspect there is a problem with the token refresh every hour:

https://github.com/supabase/gotrue-js/blob/3501d62e4a8435a1bd749ca39cb01dc5e14efbfa/src/GoTrueClient.ts#L407

And probably the line this.currentSession.user here:

https://github.com/supabase/gotrue-js/blob/3501d62e4a8435a1bd749ca39cb01dc5e14efbfa/src/GoTrueClient.ts#L424

I'll move this to the gotrue-js repo

@kiwicopple kiwicopple transferred this issue from supabase/supabase-js Feb 16, 2021
@awalias
Copy link
Member

awalias commented Apr 7, 2021

duplicate of #32

@awalias awalias closed this as completed Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants