stripe-sync-engine
stripe-sync-engine copied to clipboard
`invoice.upcoming` is not supported
Bug report
- [x] I confirm this is a bug with Supabase, not with my own application.
- [x] I confirm I have searched the Docs, GitHub Discussions, and Discord.
I've checked the above - but this is a bug report about the Stripe Sync Engine not Supabase...
Describe the bug
In the README, invoice.upcoming is marked as an event that is handled and supported. It is not. When an invoice.upcoming event is sent, a 500 is returned with the following error:
{
"statusCode": 500,
"code": "23502",
"error": "Internal Server Error",
"message": "null value in column "id" of relation "invoices" violates not-null constraint",
}
To Reproduce
Receive an invoice.upcoming event from Stripe.
Expected behavior
No errors.
System information
Using Docker version: supabase/stripe-sync-engine:v0.32.2
I see - as the id is the primary key of the invoices table, we cannot re-use the invoices table for upcoming invoices without a larger breaking change. Upcoming invoices could technically be written to a new table, but given it has no id an upsert wouldn't work unless there is another unique identifier.
If you don't rely on the event, you can simply opt to not send the event to the sync engine to avoid any errors.
I've for now removed support for the webhook as it will never work (id is missing) and have flagged the issue as an enhancement