PagerDuty / pd-oncall-chat-topic

AWS Lambda Function that updates a Chat Room topic (eg, Slack)
Apache License 2.0
86 stars 36 forks source link

SDV-2410: Prevent crash if inactive user is found #35

Closed ThisIsFroggie closed 1 year ago

ThisIsFroggie commented 1 year ago

If a schedule in PagerDuty contains inactive users, then the lambda will crash with a Key error trying to get data from the user that is not there.

This catches that explicit error and shows the user as deactivated, using the Summary field, which is present, to show their name.

To test it I've ran the lambda with a placeholder pagerduty schedule and user, and then deleted the user, running the lambda between each step to ensure it worked with a valid user and with an inactive user.

margueritepd commented 1 year ago

oooh I forgot to ask, could you add notes about what you did to test to your pull request description? thanks!!