From c84ec093d7274b6402bfaf0e3872dd6b637599a4 Mon Sep 17 00:00:00 2001 From: Maurice Date: Mon, 30 Nov 2026 15:20:06 +0100 Subject: [PATCH] fix(journey): a failed notification never fails the write it reports The contributor invite and the comment notification read the actor's name before the fire-and-forget send, so a failing lookup turned an already saved contributor or comment into an error answer. --- server/src/nest/journey/journey-comments.service.ts | 4 ++-- server/src/nest/journey/journey.service.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/nest/journey/journey-comments.service.ts b/server/src/nest/journey/journey-comments.service.ts index 13f38b714..77be8dcff 100644 --- a/server/src/nest/journey/journey-comments.service.ts +++ b/server/src/nest/journey/journey-comments.service.ts @@ -72,7 +72,7 @@ export class JourneyCommentsService { body, }); await this.announce(journeyId, entryId, id, 'added', sid); - await this.notifyOwner(journey.user_id, journey.title, entry, { kind: 'user', userId }); + await this.notifyOwner(journey.user_id, journey.title, entry, { kind: 'user', userId }).catch(() => {}); const row = await this.commentsRepo.findWithAuthor(id); if (!row) throw new DomainError(404, 'Comment not found'); return toJourneyComment(row, userId); @@ -139,7 +139,7 @@ export class JourneyCommentsService { }); await this.announce(link.journey_id, entryId, id, 'added'); const journey = await this.journeysRepo.findById(link.journey_id); - if (journey) await this.notifyOwner(journey.user_id, journey.title, entry, { kind: 'guest', name }); + if (journey) await this.notifyOwner(journey.user_id, journey.title, entry, { kind: 'guest', name }).catch(() => {}); } private async requireAccess(journeyId: number, userId: number) { diff --git a/server/src/nest/journey/journey.service.ts b/server/src/nest/journey/journey.service.ts index 98918c9ef..72809537d 100644 --- a/server/src/nest/journey/journey.service.ts +++ b/server/src/nest/journey/journey.service.ts @@ -149,7 +149,7 @@ export class JourneyService { async addContributor(id: number, userId: number, targetUserId: number, role: 'editor' | 'viewer') { const alreadyIn = (await this.journey.canAccessJourney(id, targetUserId)) !== null; const added = await this.journey.addContributor(id, userId, targetUserId, role); - if (added && !alreadyIn) await this.notifyInvite(id, userId, targetUserId, role); + if (added && !alreadyIn) await this.notifyInvite(id, userId, targetUserId, role).catch(() => {}); return added; }