parse-community / parse-community/parse-server

node crashes when promise rejection occurs in apiCallback

Open
#8,496 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

New Issue Checklist
Issue Description

When trying to send a mail with wrong server configuration, the adapter returns a success but when the transporter promise is rejected it falls back to parse which makes node crash by throwing an error.

Steps to reproduce

Use bad configuration in the transported or simply return a rejected promise in apiCallback

Actual Outcome

Crash report printed from node_modules/parse-server/lib/ParseServer.js#L261

Expected Outcome

The error should be handled or we should have the possibility to wait for a sucess/failure of the sending before returning to the client.

Failing Test Case / Pull Request
Environment
  • API Mail Adapter version: 2.2.0
  • Parse Server version: 5.4.0
Logs
express:router dispatching POST /requestPasswordReset
node_modules/parse-server/lib/ParseServer.js:261
          throw err;
          ^
Waiting for the debugger to disconnect...

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

Start at node_modules/parse-server/lib/ParseServer.js#L261 and trace how a rejected transporter promise or apiCallback rejection reaches that throw. Reproduce the issue with bad mail-server configuration or a rejected apiCallback promise. Done should prevent the Node.js process from crashing and define how the sending failure is reported, but the expected client-facing behavior remains unspecified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.