Error when two users on app get authorization token at the same time.
Hi there! I'm currently building a web app on convex where two users can join a room together and add their favorite spotify songs to shared a playlist. The app works fine apart from instances when users add songs to a playlist at the same time which leads to the app crashing for one of the users. After some debugging, I believe this is an issue related to convex/my implementation of it. When I try to get the authorization token of one of the users from convex, it fails, leading to the crash. Specifically, the auth object is "null." Any idea what could be causing this? Thanks!
3 Replies
Are you testing with both of these users in the same browser? If so, I suspect the second user that logs in will invalidate the first user's auth (the auth that's stored in cookies / localstorage / etc)
No this occurs on two different browsers/devices.
Very interesting, I would put in logs in the client, showing the token from the provider and the Convex authentication status and see if you can bisect the problem. Or share some related code so we can see how you are using it.