pages-core
pages-core copied to clipboard
Error handling organization webhook requests
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)
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.