parse-community / parse-community/parse-server

errorMessage field in _PushStatus contains incorrect field

Open
#8,029 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names the _PushStatus class but no file or test; start by tracing how its errorMessage field is assembled in Parse Server. Reproduce a failed push using the documented example and compare the returned key with the expected error key; done means the response is consistent with other server errors and the behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, swift
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.