wp-calypso icon indicating copy to clipboard operation
wp-calypso copied to clipboard

Marketplace: Product Licensing - Create database table for storing info related to Webhooks for each subscription event

Open gavande1 opened this issue 2 years ago • 2 comments

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

gavande1 avatar Jul 07 '22 11:07 gavande1

After this, we can also implement a retry mechanism.

Related discussion p1658311669561879-slack-C02JPCHEKDY

cpapazoglou avatar Jul 20 '22 10:07 cpapazoglou

Tasks:

  • [ ] update db schema
  • [ ] store the webhook event results

cpapazoglou avatar Jul 21 '22 13:07 cpapazoglou

A P2 was written to discuss the table structure pdt2If-iV-p2

JulianBustamante avatar Aug 15 '22 11:08 JulianBustamante

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?

obenland avatar Aug 15 '22 16:08 obenland

The table schema is created at 2d715-pb/#sql

gavande1 avatar Aug 30 '22 08:08 gavande1

Let's change the table name to store_vendor_webhooks so that it includes the word store

cpapazoglou avatar Aug 30 '22 08:08 cpapazoglou

Updated schema: 2d74f-pb/#sql

gavande1 avatar Aug 30 '22 09:08 gavande1

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?

gavande1 avatar Aug 30 '22 10:08 gavande1

Tables are created: pMz3w-fQr-p2#comment-101446

gavande1 avatar Sep 01 '22 06:09 gavande1