Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create nested embedded objects in list #1669

Open
emirhanaydin opened this issue Sep 2, 2024 · 1 comment
Open

Unable to create nested embedded objects in list #1669

emirhanaydin opened this issue Sep 2, 2024 · 1 comment

Comments

@emirhanaydin
Copy link

Describe the bug
When attempting to create a nested embedded object in an embedded object list in Realm Studio, the following error is displayed:

Couldn't create the City:
Cannot read properties of null (reading 'push')

To Reproduce
Steps to reproduce the behavior:

  1. Define the schemas as shown below:
class City extends Realm.Object<City> {
  static schema: Realm.ObjectSchema = {
    name: 'City',
    embedded: true,
    properties: {
      name: 'string',
    },
  };

  name!: string;
}

class Address extends Realm.Object<Address> {
  static schema: Realm.ObjectSchema = {
    name: 'Address',
    embedded: true,
    properties: {
      street: 'string',
      city: 'City',
    },
  };

  street!: string;
  city!: City;
}

class Person extends Realm.Object<Person> {
  static schema: Realm.ObjectSchema = {
    name: 'Person',
    primaryKey: '_id',
    properties: {
      _id: 'objectId',
      name: 'string',
      addresses: 'Address[]',
    },
  };

  _id!: Realm.BSON.ObjectId;
  name!: string;
  addresses!: Realm.List<Address>;
}
  1. Attempt to create a City object within an Address object.
  2. See error.

Expected behavior
The City object should be created without errors.

Screenshots
realm-studio-error

Versions:

  • OS: Windows 11 Version 23H2 (OS Build 22631.4037)
  • Studio Version 15.2.1

Additional context
This issue does not occur when creating the same objects using the Node.js SDK.

Copy link

sync-by-unito bot commented Sep 2, 2024

➤ PM Bot commented:

Jira ticket: RSTUDIO-541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant