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

Process keep hanging after electron app is closed (Windows)

      How frequently does the bug occur?

      Always

      Description

      After closing a realm connection, I expect that realm kills all processes related to Realm, but instead there's always one process that keeps hanging on Windows. This doesn't seem happen on MacOS, just Windows.

      Stacktrace & log output

      No response

      Can you reproduce the bug?

      Always

      Reproduction Steps

      • First thing you need to setup an electron app, which you can use this template for an easy setup.
      • Go to release/app and run yarn install realm.
      • Create any Realm App with Sync (flexible) enabled.
      • Open the realm connection in the main process of Electron.
      • Close the realm connection before exiting the app.
      • Check task manager for hanging process.

      Example code:

      ...
      const app = RealmApp({ id: 'MY_REALM_ID' });
      
      const openRealm = async () => {
          // run realm login
      
          const realm = await Realm.open({
              schema: [MySchema],
              sync: {
                  user: app.currentUser,
                  flexible: true,
              }
          });
         realm.close();
      }
      ...
      

      After the above code runs and you close the app, there will be one process from the app still running. If I don't call the function openRealm, all processes are closed.

      I also tested without using sync, and for that everything works fine, so I'm guessing it's something related to syncSession. Example:

      ...
      const openLocalRealm = async () => {
      
          const realm = await Realm.open({
              schema: [MySchema],
          });
         realm.close();
      }
      ...
      

      This code works as expected, no process hangs after app is closed.

      Version

      11.7.0

      What services are you using?

      Atlas Device Sync

      Are you using encryption?

      Yes

      Platform OS and version(s)

      Windows 10 Pro 22H2

      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: