Urgent.News

What's breaking now, across thousands of outlets.

Tech

Admit the Event Before the Free Model Touches It

I keep replaying one ugly afternoon whenever a webhook and a free model share the same request. The billing provider retried, the free server restarted, and two explanations landed for one event that nobody had firmly admitted. A zero price had become the excuse to call the model before the database said yes. Was I debugging a flaky model, or was the request path doing a job it should never own?…

The article emphasizes the importance of admitting an event in a durable outbox before a free model processes it. The billing webhook, which carries event ID, account ID, and reason code, should first admit the event by inserting a row into an outbox table with a unique key. This prevents duplicate writes if the free model retries or the server restarts.

The admission route should be simple, checking a shared secret, inserting the outbox row, and returning a 202 status code. If the insert hits a unique constraint, it returns 202 without calling the model. The article warns against spending a fragile free call before verifying the event will not arrive again.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Monday 12 October →