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

Re-Authenticate Last-User during App restart while OFFLINE

      How frequently does the bug occur?

      Always

      Description

      Hello,

      I encountered a problem with my realm setup. For some reason the user gets logged out if he closes the app while being offline. But I want him to stay logged in all the time until he logs out manually.

      I use React Native, flexible sync and I wrap the RealmProvider by AppProvider as well as UserProvider.

      My code looks like this:

      const realmFileBehavior = {
          type: "downloadBeforeOpen",
          timeOut: 1000,
          timeOutBehavior: "openLocalRealm"
      }
      
      <AppProvider id="...">
          <UserProvider fallback={<SignIn />}>
              <RealmProvider sync={{
                  flexible: true,
                  existingRealmFileBehavior: realmFileBehavior,
                  newRealmFileBehavior: realmFileBehavior
              }}>
                 ...
              </RealmProvider>
          </UserProvider>
      </AppProvider>
      

      If I restart the app while being offline the SignIn component is displayed. So I assume that the UserProvider can’t get the user. But I want the user to be logged in until he logs out regardless of internet connection. Is that possible?

      Best

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Always

      Reproduction Steps

      No response

      Version

      11.3.1

      What services are you using?

      Atlas App Services: Functions or GraphQL or DataAPI etc

      Are you using encryption?

      No

      Platform OS and version(s)

      iOS 15

      Build environment

      Which debugger for React Native: ..

      Cocoapods version

      No response

            Assignee:
            andrew.meyer@mongodb.com Andrew Meyer
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: