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

Issue when we use realmContext and Realm.config at same time

      How frequently does the bug occur?

      Always

      Description

      Hi @kneth and @takameyer ,

      Here is a problem i have found with realm.

      @realm/react is hook i am using in view components to for CURD operations.
      I am using Realm.config in RealmMangerClass for listening the changes in old fashion and changed data was updated to server. I am writing the response from server to realm. These are all happing in RealmManager

      In this way. i am initialising same config at two place. createRealmContext at App.js and Realm.open in RealmManager class

      In random case both (RealmContext and Realm.open) > write to db.
      This is causing two errors:

      1. realm already in write transaction
      2. [Error: Exception in HostFunction: Accessing object of type Tasks which has been invalidated or deleted]

      Is there any way i can get reference of realm from createRealmContext. where i can use it in RealmManager class instead of initialising again in Class

      I want to use hook on UI and listen to listener and do CURD operations in old fashion at same time.

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Always

      Reproduction Steps

      No response

      Version

      11.3.1

      What services are you using?

      Local Database only

      Are you using encryption?

      No

      Platform OS and version(s)

      android 13

      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:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: