Nodejs realm.sync.changeEvent realm.write throws Segmentation fault: 11


#1

Node version v8.11.3
Npm version v6.2.0
Npm package realm v2.14.0

Scenario:

  1. Client creates a new regular realm user
  2. Opens a realm at path ‘/~/user-realm’ using provided schemas
  3. Nodejs server listens to changes on ‘user-realm’ paths
  4. Client inserts a new specific record
  5. Nodejs server listens to that insertion does some api call and inserts a bunch of new records using change.event realm instance

If i try to insert a new record using changeEvent.realm.write without a field that i have made optional (tried writing schema with ‘string?’, {type: ‘string’, default: ‘someString’, optional: true}) nodejs crashes with segmentation fault. There is no error that the field is required! When I do provide the value for that field the transaction finishes without a segmentation fault. If I provide a wrong value I catch a normal error that the value provided should be of different type which is normal.

This is a very big issue since i have a lot of optional fields in my schema’s and trying to write new records through this instance of realm is not working without having to provide values for all of them. And the fact that I can not catch the error with try/catch block makes it even worse.

I am sure my schemas are valid since if I try doing the same thing through a realm instance that i get when doing Realm.open() there is no fault and the write transaction passes without any problems even though i had not provided the values for the fields that are optional.

Please respond as soon as possible.


#2

@miloban Can you open a ticket at support.realm.io with a reproduction case? We will get this sorted for you


#3

Yes of course I can, thank you for your answer.