-
Notifications
You must be signed in to change notification settings - Fork 10
Description
I've implemented the webhook-based product syncing, but it appears that the products will only be added to convex when the product created webhook is triggered when it is created in polar after things are all setup.
This means polar products won't get synced if you connect a new convex project to an existing polar project.
This is problematic for local dev and for ensuring consistency between polar and convex (if say, a product is made while the database is offline for some reason).
So, unless I'm missing something, I'm wondering about what is the best approach to ensure that products are consistent without purely relying on the use of webhooks.
Two approaches I can think of:
- Restoring from a backup that includes the product details
- Some kind of process to pulls products from polar and upserts them to convex
Restoring from an export isn't great as it will need to be manually maintained as products are managed. A startup script or cron job that checks for existing products seems better.
So;
- Am I on the right path here or am I missing something?
- If a startup / cron script to sync is a good idea, where should this go?
- For the time being, I guess a convex cron job can do this within the project, but perhaps this common use case that should be part of this package/component - are PRs welcome to implement something like this?
Thank you.