Skip to content

Passing a SchemaRecord to ember isEmpty brings Error: No field named unknownProperty on user #10096

@mkszepp

Description

@mkszepp

While making tests with schema record / warp-drive (polaris mode) i was running into error Error: No field named unknownProperty on user.

This occors, if you pass a schema record to isEmpty(), imported from @ember/utils.

While i confirm, that using isEmpty make not really sense with warp-drive, its a possible issue for users which are moving an old app to warp-drive

Is there any was to fix this?

Here my used schemas:

const LoginUserSchema = withDefaults({
  type: 'login/user',
  fields: [
    {
      kind: 'field',
      name: 'guid',
      type: 'guid',
    },
    {
      kind: 'field',
      name: 'userName',
      type: 'string',
    },
    {
      kind: 'field',
      name: 'emailAddress',
      type: 'string',
    },
    {
      kind: 'field',
      name: 'language',
      type: 'number',
    },
    {
      kind: 'field',
      name: 'creationDate',
      type: 'date',
      options: { nullable: false },
    },
    {
      kind: 'field',
      name: 'modificationDate',
      type: 'date',
      options: { nullable: false },
    },
    {
      kind: 'belongsTo',
      name: 'privilegeRole',
      type: 'login/privilege-role',
      options: { async: false, inverse: 'users', linksMode: true },
    },
  ],
});

const LoginPrivilegeRoleSchema = withDefaults({
  type: 'login/privilege-role',
  fields: [
    {
      kind: 'field',
      name: 'name',
      type: 'string',
    },
    {
      kind: 'field',
      name: 'name',
      type: 'string',
    },
    {
      kind: 'field',
      name: 'privileges',
      type: 'array',
    },
    {
      kind: 'hasMany',
      name: 'users',
      type: 'login/user',
      options: { async: false, inverse: 'privilegeRole', linksMode: true },
    },
  ],
});

Ember: 6.6
EmberData / WarpDrive: 5.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions