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

errorMessage field in _PushStatus contains incorrect field #8029

Open
4 tasks done
cbaker6 opened this issue Jun 8, 2022 · 2 comments
Open
4 tasks done

errorMessage field in _PushStatus contains incorrect field #8029

cbaker6 opened this issue Jun 8, 2022 · 2 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@cbaker6
Copy link
Contributor

cbaker6 commented Jun 8, 2022

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

@parse-github-assistant
Copy link

parse-github-assistant bot commented Jun 8, 2022

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.

@mtrezza
Copy link
Member

mtrezza commented Jun 8, 2022

errorMessage": ["code": 105, "error": "Invalid

This should follow whatever naming convention is decided in #7444, so we get to some uniformity.

If push errors are currently handled correctly by SDKs and no functionality is impaired, then this is an inconvenience but not a bug, hence classified as feature-related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

2 participants