-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: Q3-24FY
-
Component/s: Electron, Node.js, React Native
-
2 - S (<= 1 week)
-
3729
Goals
We want to give users a way to catch any sync related error.
Expected Results
In particular, we should enable users to catch the "sync is not enabled for this app" error printed by the sync client log while connecting to a server that doesn't have sync enabled:
> Connection[1]: Session[1]: client_reset_config = false, Realm exists = true, async open = false, client reset = false
> Connection[1]: Connected to endpoint '::1:9090' (from '::1:62498')
> Connection[1]: Received: ERROR "sync is not enabled for this app" (error_code=101, try_again=0, session_ident=0)
> Connection[1]: Connection closed due to error reported by server: sync is not enabled for this app (101)
Actual Results
The error is logged, but the promise returned by Realm.open neither resolves nor rejects.
I speculate reason that the error callback isn't called might be because the error is not associated with a particular session.
Steps to Reproduce
- Instantiate an App instance of a Realm App that doesn't have sync enabled.
- Try opening a Realm on that server (using new Realm or Realm.open) and notice how the error isn't thrown or logged (when a config.sync.error callback is provided).
Code Sample
new Realm({ sync: { user: app.currentUser, partitionValue: "something", error: (session, error) => { console.error("err", error); }, }, });
Version of Realm and Tooling
- Realm JS SDK Version: v10.4.0
- Node or React Native: Both
- Client OS & Version: N/A
- Which debugger for React Native: None