Skip to content

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Oct 23, 2022

New Pull Request Checklist

Issue Description

Related issue: #8255
Closes: #8255

Approach

Handle error in triggers by catching the error and returning a Parse error.

TODOs before merging

  • Add tests

@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 23, 2022

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@dplewis
Copy link
Member

dplewis commented Oct 31, 2022

maybeRunTrigger needs to be returned here

_runAfterLogoutTrigger(req, session) {
// After logout trigger
maybeRunTrigger(
TriggerTypes.afterLogout,
req.auth,
Parse.Session.fromJSON(Object.assign({ className: '_Session' }, session)),
null,
req.config
);
}

_runAfterLogoutTrigger runs in background and needs the promise to resolve or reject

this._runAfterLogoutTrigger(req, records.results[0]);

@dplewis
Copy link
Member

dplewis commented Nov 3, 2022

@mtrezza Have you looked into the changes I recommended? I believe the crash is because of the afterLogout trigger only

@mtrezza
Copy link
Member Author

mtrezza commented Nov 3, 2022

This is superseded by #8280, I'll post a comment there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server crashes when throwing inside Cloud Code trigger

2 participants