Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

ralph(M15-117): Per-module fixes: packages/core/src/modules/notification - R11, R16 and the findings no rule covers

ralphf7152a5b7b03
diff --git a/packages/core/src/modules/notification/notification.service.ts b/packages/core/src/modules/notification/notification.service.ts
index c97d6d983..81d6ab4fd 100644
--- a/packages/core/src/modules/notification/notification.service.ts
+++ b/packages/core/src/modules/notification/notification.service.ts
@@ -335,6 +335,13 @@ export async function deliverNotification(
const payload = notification.payload;
const PrismaRuntime = await loadPrismaSentinels();
+ // Returning rather than throwing here (and in the missing-config branch
+ // below) resolves `notificationQueueJobs.sendNotification`'s promise
+ // normally, so BullMQ records the job as completed instead of failed —
+ // the delivery is silently dropped. Left as-is: no test exercises either
+ // branch today, and flipping the job outcome from success to failure is a
+ // behavior change out of this task's scope (docs/review/notification.md,
+ // "Not covered by any rule" #1).
if (
!isValidPayload<INotificationPayload>(
payload,
@@ -517,6 +524,13 @@ export async function deleteNotificationRule(deps: ServiceDeps, id: string) {
// -- Services surface --------------------------------------------------
+// This wraps only `dispatch` (what notification.jobs.ts needs). Every other
+// function above and in ./src/notification-dispatch.ts is called directly —
+// by notification.rpc.ts, by session/ingest as siblings, and by index.ts's
+// barrel — not through ctx.services.notification. Consolidating that would
+// mean changing those other modules' call sites, out of this task's scope
+// (docs/review/notification.md, "Not covered by any rule" #2; the same
+// shape misc.md's MiscService finding describes for that module).
export function createNotificationService(
deps: ServiceDeps,
_services: () => Services
diff --git a/packages/core/src/modules/notification/src/notification-dispatch.ts b/packages/core/src/modules/notification/src/notification-dispatch.ts
index 9a87ad5e0..130867a74 100644
Binary files a/packages/core/src/modules/notification/src/notification-dispatch.ts and b/packages/core/src/modules/notification/src/notification-dispatch.ts differ