fix(plugins): handle a failed addon read while an earlier trip event still waits

The addon read of a queued plugin event now settles to off on its own, so a rejection that comes before the earlier event's turn can no longer go unhandled and stop the server.
This commit is contained in:
Maurice
2026-11-23 15:41:22 +01:00
parent 5d7d6072f7
commit 807c6a16b4
2 changed files with 29 additions and 1 deletions
@@ -49,7 +49,7 @@ export function tripEventSink(addons: AddonsService, orm: MikroORM | undefined,
const before = queues.get(tripId);
if (!addonId && !before) return deliver(tripId, event, meta);
const ask = () => (addonId ? addons.isEnabledForTrip(tripId, addonId) : Promise.resolve(true));
const on = orm && addonId ? withRequestContext(orm, ask) : ask();
const on = (orm && addonId ? withRequestContext(orm, ask) : ask()).catch(() => false);
const queued = (before ?? Promise.resolve())
.then(() => on)
.then((open) => {