[Problem/Question]
I’m having issues logging into sendbird-uikit-react-native sample app. The app is running in the ios emulator
WARN [UIKIT_ios] [useConnection] clear cached-data
WARN [UIKIT_ios] [useConnection] connect failure This session token is invalid. 400302
LOG [UIKit/promiseUnhandled] [SendbirdError: This session token is invalid.] 400302
// If problem, please fill out the below. If question, please delete.
[UIKit Version]
“@sendbird/uikit-react-native”: “^3.2.0”
[Reproduction Steps]
- Replaced the
APP_ID
in the env.ts
file with the Application ID from our SendBird dashboard.
- Left the
API_TOKEN
field empty in the env.ts
file.
- Created a user under our application in SendBird web app and ensured the “Issue access token” checkbox was checked.
- Login with the created user’s user_id and nickname in sendbird-uikit-react-native sample app
[Frequency]
Every time
[Current impact]
cannot connect
Hi @Marcel_Anis,
The issue is that when you created the Sendbird User with “Issue access token” checked, the user is now required to use an access or session token to authenticate to Sendbird. This is why the error “This session token is invalid.” is being returned, because no valid access/session token is being provided during the login process.
If you create a user without “Issue access token” checked, that user will be able to login/authenticate to Sendbird with just their user_id within the sample app.
Thank you,
Adam
Hi Adam,
I created a user without “Issue access token” checked. I am still getting the error when pressing the Login button:
LOG [UIKit/promiseUnhandled] [SendbirdError: Connection timeout.] 800190
Also, even before pressing the Login button, I am getting this warning in the console on app start:
WARN [UIKIT_ios] [useConnection] connect failure Connection timeout. 800190
Seems like the error on login button press and the warning on app start are related as they have the same error code “800190”
Please advise on how to proceed.
Thanks
Marcel
Not sure if this is relevant but here is another thing I tried:
Previously I cloned the project from the sample directory
The above was giving me connection timeout errors.
Later I tried cloning it from the root folder
But when running the cloned app from root folder I get another error:
success Successfully launched the app on the simulator
[1] react-native run-ios exited with code 0
[0] BUNDLE ./index.js
[0]
[0] error: TypeError: Cannot read properties of undefined (reading 'transformFile')
[0] at Bundler.transformFile (/Users/marcelanis/dev/sendbird-uikit-react-native/node_modules/metro/src/Bundler.js:48:30)
[0] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[0] at async Object.transform (/Users/marcelanis/dev/sendbird-uikit-react-native/node_modules/metro/src/lib/transformHelpers.js:101:12)
[0] at async processModule (/Users/marcelanis/dev/sendbird-uikit-react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:18)
[0] at async traverseDependenciesForSingleFile (/Users/marcelanis/dev/sendbird-uikit-react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:131:3)
[0] at async Promise.all (index 0)
[0] at async initialTraverseDependencies (/Users/marcelanis/dev/sendbird-uikit-react-native/node_modules/metro/src/DeltaBundler/traverseDependencies.js:114:3)
[0] at async DeltaCalculator._getChangedDependencies (/Users/marcelanis/dev/sendbird-uikit-react-native/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:164:25)
[0] at async DeltaCalculator.getDelta (/Users/marcelanis/dev/sendbird-uikit-react-native/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:94:16)
[0] at async DeltaBundler.buildGraph (/Users/marcelanis/dev/sendbird-uikit-react-native/node_modules/metro/src/DeltaBundler.js:50:5)
Let me know I should be cloning the app from the root folder or the sample directory
Thanks
Marcel
Hi Marcel,
You can just clone the sample, that should be fine.
The 800190 error means thats the application did not receive a response from Sendbird’s servers within the default timeout.
You can increase the websocketResponseTimeout, which will increase the amount of time the UIKit and SDKs wait for a response from the Sendbird server. SendbirdChatOptions | Sendbird Chat SDK Reference - v4.12.7
You can add options: { websocketResponseTimeout : 30000 } to the UIKit or SDK initialization to increase this.
Was there any network related changes between testing with the previous user and now? These types of errors typically indicated some type of network instability.
Thank you,
Adam
I had to clone the from the root and not the sample. Then downgrade my node version from v20.13.1 to v16.13.0.
Now I can login.
Thanks for all your help.
Marcel