Skip to content

TypeError: Cannot read property 'protectedFields' of undefined #8406

Closed
@dplewis

Description

@dplewis

New Issue Checklist

Issue Description

If there are no classLevelPermissions in the schema perm below is undefined thus the error. A simple check should fix this issue since a check for perm already exist within the filterSensitiveData function but I'm not familiar with protectedFields.

// fields not requested by client (excluded),
//but were needed to apply protecttedFields
perms.protectedFields &&
perms.protectedFields.temporaryKeys &&
perms.protectedFields.temporaryKeys.forEach(k => delete object[k]);

Steps to reproduce

I accidentally ran into this issue while fixing a flaky test on the JS SDK. I don't have a way to reproduce this error server side.

Actual Outcome

Unhandled promise rejection

Expected Outcome

No errors

Environment

Server

  • Parse Server version: 6.0.0-alpha.27
  • Operating system: Mac
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): Mongodb
  • Database version: 4.10.0
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JS
  • SDK version: 4.0.0

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions