Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
172 stars 69 forks source link

Change storage for webhook events #5374

Open htdat opened 1 year ago

htdat commented 1 year ago

From p1671520152621799-slack-C0208C3BXHP

Description

Currently, webhook reliably service class is using transients as a storage for webhook events.

However, with a nature of WordPress with many types of hosting, caching, plugins, transients appear not stable enough for our purpose.

@james-allan got a specific case for this:

I was on a customer’s site I noticed they have the Breeze cache plugin running and from past experience with these kind of plugins, I know they can do some strange things with transients like treating the expiration as a timestamp and not a number of seconds. This particular one seems to suggest it purges expired transients but the database query to me looks like it just deletes them all.

Acceptance criteria

Testing instructions

TBA

Dev notes

TBA

Additional context

TBA

zmaglica commented 1 year ago

Before we start to work on this issue, we need to decide what storage mechanism we should use. I guess that we can use database to store webhook events, and we can clean them afterward by using cron tasks or manually once certain event is no longer needed.

htdat commented 1 year ago

I think @RadoslavGeorgiev is working on this issue for the cooldown week of Gamma sprint 2 https://github.com/Automattic/woocommerce-payments/pull/5407

Moving this issue to Gamma backlog and connecting it with PR 5407.