-
Type: Bug
-
Resolution: Incomplete
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
Description
I'm testing the pre-release branch with our existing app. Removing a filtered list of {{Realm.ObjectClass}}es now throws an error but worked in 10.20.0 and earlier.
function removeFilteredThings() {
const thingsToBeRemoved = realm
.objects<RealmThing>(RealmThing.schema.name)
.filter(realmThing => realmThing.toDomainObject().when.isBefore(LocalDateTime.now(clock)))
realm.write(() => {
realm.delete(thingsToBeRemoved)
})
}
The objects appear to be Realm objects according to the debugger (they have __Realm_internal and _realm properties. All of our properties show as propName: Error: Exception in HostFunction: Realm accessed from incorrect thread. but I'm assuming that's down to Safari debugger trying to access the prop while paused on the thrown exception inside the realm.write() callback?
Stacktrace & log output
Error is: `Error: Exception in HostFunction: Argument to 'delete' must be a Realm object or a collection of Realm objects.`
JS stack trace should be irrelevant since it's all within our code.
Can you reproduce a bug?
Yes, always
Reproduction Steps
Let me know if you can't reproduce and need me to try and come up with a minimal repro.
Version
hermes (10.20.0-beta.1)
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
RN 0.66.3 using JSC (not Hermes!) - iPhone 13 Simulator w/ iOS 15.2, Android AVD Emulator running Android 9.0