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

Sync configuration being undefined or missing entirely should produce the same behaviour

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      How frequently does the bug occur?

      All the time

      Description

      When opening a Realm and passing in undefined as the sync property on the config the library should behave the same as if the key is missing entirely. This is currently not the case.

      If the property is present but the value is undefined, opening the Realm will throw:

      TypeError: Cannot read property 'newRealmFileBehavior' of undefined
      

      The offending line is this: https://github.com/realm/realm-js/blob/master/lib/extensions.js#L167

      It would be great to support opening the Realm as a local Realm if config.sync === true as well.

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Yes, always

      Reproduction Steps

      No response

      Version

      10.8.0

      What SDK flavour are you using?

      Local Database only

      Are you using encryption?

      No, not using encryption

      Platform OS and version(s)

      N/A

      Build environment

      No response

            Assignee:
            tom.duncalf@mongodb.com Tom Duncalf (Inactive)
            Reporter:
            kraen.hansen@mongodb.com Kræn Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: