-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
2 - S (<= 1 week)
-
2638
Goals
Calls to realm.create() should either create an object or throw (while in a manual transaction).
Expected Results
If realm.create throws, I expect no side-effects on the database (ie. no rows with default values created).
Actual Results
Calling realm.create with missing values, while in a manual transaction throws but also creates an object with default values.
Steps to Reproduce & Code Sample
const Realm = require("realm"); const realm = new Realm({ schema: [ { name: "SomeClass", properties: { name: 'string', age: 'int' } } ] }); realm.beginTransaction(); realm.create('SomeClass', { age: 13 })
☝️ throws
Error: Missing value for property 'SomeClass.name'
Listing the objects afterwards reveals an object was actually created:
realm.objects('SomeClass') // Results { [0]: RealmObject { [name]: '', [age]: 0 } }
Version of Realm and Tooling
- Realm JS SDK Version: 3.5.0
- Node or React Native: N/A
- Client OS & Version: N/A
- Which debugger for React Native: None