-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Expected results
Absence of deadlocks.
Actual Results
Process locks up waiting for m_user_mutex on https://github.com/realm/realm-core/blob/72fefa1b0c07cb87e1078c039d1d9572dd92fa58/src/realm/object-store/sync/app.cpp#L600 when the current_user is accessed from an "app listener callback".
Very similar to https://github.com/realm/realm-core/issues/7183 (except this was for User).
Steps & Code to Reproduce
The following JS code reproduce the issue:
import Realm from "realm"; const app = Realm.App.get("realmjstestapp-jjhtf"); const credentials = Realm.Credentials.anonymous(false); setInterval(() => { console.log("Still alive"); }, 1000); app.addListener(() => { console.log("Current user is", app.currentUser); }); await app.logIn(credentials);
Core version
Core version: https://github.com/realm/realm-core/commit/8f9661524e3087d9886456d2ce555ea2629eb813 (most likely caused by https://github.com/realm/realm-core/pull/7300)