mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
fix(server): stop a failed notification import from crashing the run
The fire-and-forget notification sends guard the send() call but not the dynamic import around it, so a rejected import escapes as an unhandled rejection. In CI that surfaced as an EnvironmentTeardownError from vacay after the suite had already passed, failing the run with every test green. trips, packing and collections already catch on the import chain; collab and the two vacay sends were missing it.
This commit is contained in:
@@ -500,6 +500,6 @@ export class CollabService {
|
||||
const params: Record<string, string> = { trip: tripInfo?.title || 'Untitled', actor: actor.email, tripId: String(tripId) };
|
||||
if (preview !== undefined) params.preview = preview;
|
||||
send({ event: 'collab_message', actorId: actor.id, scope: 'trip', targetId: Number(tripId), params }).catch(() => {});
|
||||
});
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -636,7 +636,7 @@ export class VacayService {
|
||||
// Notify invited user
|
||||
import('../notifications/notifications.bridge').then(({ send }) => {
|
||||
send({ event: 'vacay_invite', actorId: inviterId, scope: 'user', targetId: targetUserId, params: { actor: inviterEmail, planId: String(planId) } }).catch(() => {});
|
||||
});
|
||||
}).catch(() => {});
|
||||
|
||||
return {};
|
||||
}
|
||||
@@ -867,7 +867,7 @@ export class VacayService {
|
||||
|
||||
import('../notifications/notifications.bridge').then(({ send }) => {
|
||||
send({ event: 'vacay_share', actorId: ownerId, scope: 'user', targetId: targetUserId, params: { actor: ownerEmail } }).catch(() => {});
|
||||
});
|
||||
}).catch(() => {});
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user