fix(09): IN-01 add ordering comments cementing signalOutboxDrain() stays after the enqueue commit

This commit is contained in:
Lucas Berger
2026-06-12 20:50:26 -04:00
parent 8307a7b713
commit b8bb6e7671
+4
View File
@@ -307,6 +307,7 @@ eventsRouter.post('/create', zValidator('json', eventFieldsSchema), async (c) =>
payload: JSON.stringify(payload), payload: JSON.stringify(payload),
}); });
// must stay AFTER the enqueue commit — worker selects committed pending rows only
signalOutboxDrain(); signalOutboxDrain();
return c.json({ uid }, 202); return c.json({ uid }, 202);
} catch (err) { } 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(); signalOutboxDrain();
return c.json({ uid: newUid }, 202); return c.json({ uid: newUid }, 202);
} }
@@ -447,6 +449,7 @@ eventsRouter.patch('/:uid/edit', zValidator('json', eventFieldsSchema), async (c
payload: JSON.stringify(payload), payload: JSON.stringify(payload),
}); });
// must stay AFTER the enqueue commit — worker selects committed pending rows only
signalOutboxDrain(); signalOutboxDrain();
return c.json({ uid }, 202); return c.json({ uid }, 202);
} catch (err) { } catch (err) {
@@ -522,6 +525,7 @@ eventsRouter.delete('/:uid', async (c) => {
etag: eventRow.etag ?? undefined, etag: eventRow.etag ?? undefined,
}); });
// must stay AFTER the enqueue commit — worker selects committed pending rows only
signalOutboxDrain(); signalOutboxDrain();
return c.json({ uid }, 202); return c.json({ uid }, 202);
} catch (err) { } catch (err) {