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

Sync error callback definition needs an update

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      Goals

      I would expect more, precise definition of the sync error callback.

      Expected Results

      On the configuration section of the docs, I would expect that it specifies that the error callback gets called with two arguments:

      • session: The session from which the error originates.
      • err: The error that occurred. This is not an object of type Error, but instead an object with the following fields available:
        ``` { message: "SSL server certificate rejected", isFatal: true, category: "realm::sync::Client::Error", code: 117, userInfo: Object }

        ```

      I only found out that this was the case when I saw how it was used here: https://realm.io/docs/javascript/2.0.0/api/Realm.Sync.html#.initiateClientReset

      It seems to be correct in the types, except they are missing the userInfo object - which seems to be an empty object anyway.

      Actual Results

      This is how the error callback is currently documented:

      error

      • A callback function which is called in error situations. The error callback can take up to four optional arguments: message, isFatal, category, and code.

      I.e. it describes the four properties of the error object but not the signature of the actual callback.

      Version of Realm and Tooling

      • Realm JS SDK Version: 2.0.2

            Assignee:
            Unassigned Unassigned
            Reporter:
            kraen.hansen@mongodb.com Kræn Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: