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

Revisit our workaround for flushing the microtask queue after calls from C++ into JS

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      About two years ago we merged a few PRs (#4725, #4579 and #4389) working around this issue in React Native: https://github.com/facebook/react-native/issues/33006.

      About 4 months ago a PR landed in React Native hinting that this might have been solved by enabling the Hermes microtask queue when bridgeless is enabled: https://github.com/facebook/react-native/pull/43396. My initial (limited) investigation wasn't able to confirm this though (see my comments on the PR).

      Our current workaround triggers this warning in React Native's `BridgelessReactContext`:

      > BridgelessReactContext: [WARNING] Bridgeless doesn't support CatalystInstance. Accessing an API that's not part of the new architecture is not encouraged usage.

      I see a few ways forward:

      1. Trigger a flush of the microtask queue in another way, likely through JSI's `drainMicrotasks`
      2. Create a minimal reproduction for React Native to reproduce and fix the underlying issue.

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Archiver:
            marc.greenfield@mongodb.com Marc Greenfield

              Created:
              Updated:
              Archived: