Skip to content

errorMessage field in _PushStatus contains incorrect field #8029

@cbaker6

Description

@cbaker6

New Issue Checklist

Issue Description

The errorMessage field in the _PushStatus class contains a key different from most errors thrown on the server. For these particular cases, the SDKs may decode _PushStatus incorrectly.

Related to #7444

Steps to reproduce

Send a push notification that would produce an error so the errorMessage field is populated

Actual Outcome

The error message contains the key, message when most others would contain error.

["results": [["pushTime": "2022-06-08T01:39:28.694Z", "objectId": "LUYnqQCC4dQlCq70yVBPoELfJp8DazsC", "source": "rest", "numSent": 0, "errorMessage": ["code": 105, "message": "Invalid key name: _method"], "updatedAt": "2022-06-08T01:39:28.732Z", "createdAt": "2022-06-08T01:39:28.695Z", "query": "{\"_method\":\"GET\",\"limit\":100,\"skip\":0,\"where\":{\"objectId\":{\"$ne\":null}}}", "pushHash": "5064192be6a88ae013ae516b4601dc95", "ACL": [:], "status": "failed", "payload": "{\"alert\":{\"body\":\"Hello from ParseSwift!\"},\"badge\":1}"]]]

Expected Outcome

Error messages sent from the server are uniform always contain the same keys.

"errorMessage": ["code": 105, "error": "Invalid key name: _method"] // Most server errors contain "error" instead of message

Environment

Server

  • Parse Server version: 5.2.0
  • Operating system: Linux/docker
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

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

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): Swift SDK
  • SDK version: 4.5.0

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions