pages-core icon indicating copy to clipboard operation
pages-core copied to clipboard

Error handling organization webhook requests

Open davemcorwin opened this issue 4 years ago • 1 comments

This is also happening in production with the original implementation

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'user' of undefined 2021-01-27T10:39:34.67-0800 [APP/PROC/WEB/1] ERR at Object.organizationWebhookRequest (/home/vcap/app/api/services/Webhooks.js:32:32) 2021-01-27T10:39:34.67-0800 [APP/PROC/WEB/1] ERR at organization (/home/vcap/app/api/controllers/webhook.js:16:14)

davemcorwin avatar Jan 27 '21 18:01 davemcorwin

Errors are being thrown because the payload received from Github is different for the member_invited event, and is missing attributes (membership.user) that are present for member_added and member_removed events.

davemcorwin avatar Feb 01 '21 21:02 davemcorwin