From 1d0850015cc2f30ba8e570b3f715efd31d26bf46 Mon Sep 17 00:00:00 2001 From: Gagik Amaryan Date: Wed, 31 Jul 2024 17:31:08 +0200 Subject: [PATCH] Fix connection crashes --- packages/realm/bindgen/js_opt_in_spec.yml | 1 + packages/realm/src/platform/react-native/index.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/realm/bindgen/js_opt_in_spec.yml b/packages/realm/bindgen/js_opt_in_spec.yml index ef80c1274e..7cb118492f 100644 --- a/packages/realm/bindgen/js_opt_in_spec.yml +++ b/packages/realm/bindgen/js_opt_in_spec.yml @@ -521,6 +521,7 @@ classes: - update_base_url - get_base_url - immediately_run_file_actions + - close_all_sync_sessions WatchStream: methods: diff --git a/packages/realm/src/platform/react-native/index.ts b/packages/realm/src/platform/react-native/index.ts index 4eff6da924..8f27029a2e 100644 --- a/packages/realm/src/platform/react-native/index.ts +++ b/packages/realm/src/platform/react-native/index.ts @@ -26,6 +26,7 @@ import { Realm } from "../../Realm"; import { binding } from "../binding"; // Clear the internal state to prevent crashes when reloading the app +binding.App.closeAllSyncSessions(); binding.RealmCoordinator.clearAllCaches(); binding.App.clearCachedApps();