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

Logging user after register crashes app in Expo/React Native #6146

Closed
rafalnawojczyk opened this issue Sep 20, 2023 · 3 comments
Closed

Logging user after register crashes app in Expo/React Native #6146

rafalnawojczyk opened this issue Sep 20, 2023 · 3 comments
Labels
O-Community SDK-Use:Sync T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@rafalnawojczyk
Copy link

rafalnawojczyk commented Sep 20, 2023

How frequently does the bug occur?

Always

Description

I'm registering new users in an Expo app. After register I'm trying to login user, but I'm getting error:
WARN Possible Unhandled Promise Rejection (id: 2): Error: Broken Promise Error: Broken Promise at Realm_close (native)

And
{{ ERROR [Error: Timed out: Realm could not be downloaded in the allocated time: 30000 ms.]}}

When i reload app - it turns out that user is logged in. That is happening all the time.

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

This is link directly to signup screen that is producing problem.
First handleSignup fires, and after that useEffect tries to login user:
https://github.com/rafalnawojczyk/CubeRivals/blob/master/src/screens/SignupScreen.tsx

Version

12.1

What services are you using?

Both Atlas Device Sync and Atlas App Services

Are you using encryption?

Yes

Platform OS and version(s)

Android

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

@kneth
Copy link
Contributor

kneth commented Sep 25, 2023

The error message indicates a timeout when you open the Realm, and not when you log in. Said that, I am curious to see how your email/password auth provider is configured: do you use auto-confirm or do you have a flow to confirm the user?

@sync-by-unito sync-by-unito bot added SDK-Use:Sync Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Sep 25, 2023
@kneth
Copy link
Contributor

kneth commented Oct 31, 2023

I am closing the issue due to no reply back. Please create a new issue if you have new observations to share.

@kneth kneth closed this as completed Oct 31, 2023
@steve-gowildly
Copy link

For those that might also be hitting this problem - this is what I did to solve it:

  1. Go to App Services -> App Users.
  2. Under the Users tab, I deleted all of the users in there for clarity (I'm testing Mongo, this is not a production system). I did this for clarity, not because it's necessary!
  3. I re-ran my code (after deleting mongodb-realm directory from my local project - again, not likely necessary, but for clarity!)
  4. It didn't work
  5. I went back to my Users tab and refreshed the list of users - which showed the newly created Anonymous account.
  6. I clicked on the View Activity button to see what that might tell me
  7. It told me I hadn't enabled sync on the account :)

So to resolve the issue - I went to Device Sync and went through the "Enable Sync" flow - and the issue was resolved.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
O-Community SDK-Use:Sync T-Bug Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
Development

No branches or pull requests

3 participants