-
Type: Task
-
Resolution: Done
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
When I attempt to delete a record, my app instantly crashes and I cannot seem to catch the exception. From the MongoDB support team, it seems the context is being closed too soon. Any idea what is happening? This happens whether I use a listener or not.
Delete method:
const deleteList = (listId: string): void => { const listRealm = realmRef.current; const list = listRealm?.objectForPrimaryKey<List>("List", new ObjectId(listId)); try { listRealm?.write<void>(() => { if (list) { listRealm?.delete(list); } }) } catch(error) { console.log(error); } };
React Native 0.70
SDK:
android vRealmJS/10.21.1
Platform Version:
31
MongoDB version 5.0.12