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

TimeoutError thrown in NodeJS client

      How frequently does the bug occur?

      Always

      Description

      I'm using RealmJS in a NodeJS App that will sometimes start offline. When the app starts with an internet connection (and then loses/regains connectectivity intermittently) realm works great. However, when booting with no internet connection, the open() method is throwing an error.

      TimeoutError: Timed out: Realm could not be downloaded in the allocated time: 30000 ms.

      I've tried a combination of config changes (including adding timeout values) to prevent this timeout from being thrown, but all don't seem to affect this error being thrown.

          ...,
          cancelWaitsOnNonFatalError: false,
          existingRealmFileBehavior: {
            type: OpenRealmBehaviorType.OpenImmediately,
            timeOut: 1000,
            timeOutBehavior: OpenRealmTimeOutBehavior.OpenLocalRealm
          },
          newRealmFileBehavior: {
            type: OpenRealmBehaviorType.OpenImmediately,
            timeOut: 1000,
            timeOutBehavior: OpenRealmTimeOutBehavior.OpenLocalRealm
          },
      

      And

      subs.add(realm.objects(schema).filtered('tennant == $0', tennant), { behavior: WaitForSync.Never });
      

      Am I misinterpreting the timeOutBehavior property? Or is the Realm client ignoring the given value and using OpenRealmTimeOutBehavior.ThrowException ?

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      Output from internal logger
      =====================
      
      [error] Failed to resolve 'ws.eu-west-1.aws.realm.mongodb.com:443': Host not found (authoritative)
      
      
      Error thrown after 30s
      ======================
      /Users/alex/Workspace/app/node_modules/realm/src/TimeoutPromise.ts:39
                this.handle.reject(new TimeoutError(message));
      

      Can you reproduce the bug?

      Always

      Reproduction Steps

      No response

      Version

      12.3.1

      What services are you using?

      Atlas Device Sync

      Are you using encryption?

      No

      Platform OS and version(s)

      OSX Arm64 & Linux Arm64

      Build environment

      Which debugger for React Native: ..

      Cocoapods version

      No response

       

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

              Created:
              Updated: