Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphql: add debugMessages query #2052

Merged
merged 9 commits into from
Dec 15, 2021
Merged

Conversation

mastercactapus
Copy link
Member

Description:
Adds a debugMessages query that can be used by an admin to retrieve a list of recent messages from the outgoing_messages table.

return "", nil
}

return notification.Dest{Type: obj.Dest.Type, Value: obj.Status.SrcValue}.String(), nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should rely on the destination interface for formatting the source value. I sent a test message and got the following response:

Screen Shot 2021-12-07 at 4 25 22 PM

I would expect source to be the Twilio FromNumber

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, we should use the same formatting as destination and keep it as an empty string if value is blank.

*s = StateFailedPerm
case "stale":
*s = StateFailedTemp
default:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this switch missing the bundled case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh that's a good call, we may need to add a new state. Normally "bundled" messages aren't processed at all, but they would still be returned here.

dctalbot
dctalbot previously approved these changes Dec 8, 2021
Co-authored-by: David Talbot <david.talbot@target.com>
dctalbot
dctalbot previously approved these changes Dec 8, 2021
@dctalbot dctalbot requested a review from arurao December 13, 2021 16:12
@arurao
Copy link
Contributor

arurao commented Dec 14, 2021

While functionally validating I am seeing some alertIDs being returned as null. I don't think outgoing_messages table has any null values in the alertID column. Is this valid then?

Screen Shot 2021-12-13 at 10 39 37 PM

@mastercactapus
Copy link
Member Author

@arurao only alert notifications and bundles have an alert ID, test, validation, on-call, etc.. don't. Alert status updates should but don't due to an unrelated bug

@mastercactapus mastercactapus merged commit ec6722e into master Dec 15, 2021
@mastercactapus mastercactapus deleted the recent-messages-query branch December 15, 2021 15:38
@Forfold Forfold mentioned this pull request Dec 22, 2021
8 tasks
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.

3 participants