From b8bb6e767104d86aeab0187dc38aed65ce0345d4 Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Fri, 12 Jun 2026 20:50:26 -0400 Subject: [PATCH] fix(09): IN-01 add ordering comments cementing signalOutboxDrain() stays after the enqueue commit --- apps/api/src/routes/events.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/api/src/routes/events.ts b/apps/api/src/routes/events.ts index 1f675f2..ce8d899 100644 --- a/apps/api/src/routes/events.ts +++ b/apps/api/src/routes/events.ts @@ -307,6 +307,7 @@ eventsRouter.post('/create', zValidator('json', eventFieldsSchema), async (c) => payload: JSON.stringify(payload), }); + // must stay AFTER the enqueue commit — worker selects committed pending rows only signalOutboxDrain(); return c.json({ uid }, 202); } catch (err) { @@ -431,6 +432,7 @@ eventsRouter.patch('/:uid/edit', zValidator('json', eventFieldsSchema), async (c }); }); + // must stay AFTER the enqueue commit — worker selects committed pending rows only signalOutboxDrain(); return c.json({ uid: newUid }, 202); } @@ -447,6 +449,7 @@ eventsRouter.patch('/:uid/edit', zValidator('json', eventFieldsSchema), async (c payload: JSON.stringify(payload), }); + // must stay AFTER the enqueue commit — worker selects committed pending rows only signalOutboxDrain(); return c.json({ uid }, 202); } catch (err) { @@ -522,6 +525,7 @@ eventsRouter.delete('/:uid', async (c) => { etag: eventRow.etag ?? undefined, }); + // must stay AFTER the enqueue commit — worker selects committed pending rows only signalOutboxDrain(); return c.json({ uid }, 202); } catch (err) {