Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-1134

App login function freezes/hangs when React-Native environment is reloaded (press R twice) on Android

      Goals

      Fix freezing login function on App class in React-Native Android application after reloading.

      Expected Results

      Login function should not freeze.

      Actual Results

      Login function freezes/hangs forever after logging in into application when the application is reloaded.

      Steps to Reproduce

      We have a React-Native application running as Android application (in emulator, but similar thing happens on real device). When I reload the application in React-Native environment (pressing R key twice) and I try to log in then the application will freeze forever on login function in App class.

      What I already tried:

      • realmApp.allUsers[key].loggedIn - false (only one user visible in allUsers)
      • realmApp.allUsers[key].logOut() - didn't help
      • realmApp.currentUser = returns null
      • deleting realm files with adb shell commands - didn't help
      • killing the application from memory - after starting the application it works again (just by closing where the application is running in the background and starting it from there doesn't help)
      • reinstalling the application (react-native run-android) - works again

      Code Sample

      const getRealmApp = () => {
        const appConfig = {
          id: Config.REALM_DIR,
          timeout: 30000,
        };
        return new Realm.App(appConfig);
      };
      
      export const realmApp = getRealmApp();
      
      
      
      export const signIn = async jwt => {
        const creds = Realm.Credentials.jwt(jwt);
        await realmApp?.logIn(creds);  // <- the application will hang on this line
      };
      

      Version of Realm and Tooling

      • Realm npm package: 10.2.0
      • Realm JS SDK Version: ?
      • react-native: 0.63.3
      • Android: 10
      • node: v14.9.0
      • Which debugger for React Native: 0.10.7 (not connected)

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: