Skip to content

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

Closed

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

Activity

  1. parse-github-assistant commented on Jan 26, 2023

    @parse-github-assistant

    Thanks for opening this issue!

    • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.
  2. added
    type:bugImpaired feature or lacking behavior that is likely assumed
    on Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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