Delivering webhooks to GitHub Apps may be unreliable given the nature of the Internet they are like UDP: no delivery guarantee.
To solve this, I’m looking at having an event stream on the Application side.
The idea is to put any incoming events to the storage and then time to time query GitHub API to get a list of the recent events. Then, try to match those with ones stored on the App side. Finally, process events found missing locally.
I’m trying out endpoints like https://api.github.com/orgs/ansible/events, https://api.github.com/repos/webknjaz/ansible-gentoo-laptop/events, https://api.github.com/repos/ansible/ansible/events, https://api.github.com/users/webknjaz/received_events.
They seem to have payloads but there are no unique identifiers like on the recent deliveries page (e.g. https://github.com/settings/apps/ansiwatch/advanced) which have X-GitHub-Delivery listed there.
The idea (request?) is to have those IDs accessible via API as well. It seems like API exposes a numeric ID while UI exposes delivery ID. And I cannot compare 8884215857 == fbde0650-1821-11e9-8b32-053f039e511a which is unfortunate.
Any chance you could add a numeric event ID to webhook events? Or add a delivery ID to responses available via Events API? Or both?