wp-calypso
wp-calypso copied to clipboard
Marketplace: Product Licensing - Create database table for storing info related to Webhooks for each subscription event
Summary
As part of building mechanism for broadcasting realtime subscription events to vendors, we need to create database table for storing information related to all events. We would need to store information like request url, request time, requests params, raw response, response time, response code etc.
Related to pdh6GB-1dL-p2#comment-1951
After this, we can also implement a retry mechanism.
Related discussion p1658311669561879-slack-C02JPCHEKDY
Tasks:
- [ ] update db schema
- [ ] store the webhook event results
A P2 was written to discuss the table structure pdt2If-iV-p2
Can you help me understand why we need a new table for this? Why can't we just enqueue a job that sends out the request, whenever one of those five defined actions get called?
The table schema is created at 2d715-pb/#sql
Let's change the table name to store_vendor_webhooks
so that it includes the word store
Updated schema: 2d74f-pb/#sql
Can you help me understand why we need a new table for this?
We have decided to keep the history of all outgoing webhooks (not testing ones). We want to store info like what webhook URL, request payload, response code & response in raw format. In case, there is issues of any type with webhooks, we can find out what went wrong.
Also, once the vendor dashboard is ready, we can show this info in real time so they can debug production issues easily.
@cpapazoglou do you want to add anything more?
Tables are created: pMz3w-fQr-p2#comment-101446