-
Notifications
You must be signed in to change notification settings - Fork 32
feat: persist in-app notifications in Postgres (durable, cross-instance) #43
Copy link
Copy link
Closed
Labels
GrantFox OSSGrantFox open-source bounty programGrantFox open-source bounty programMaybe RewardedEligible for GrantFox reward upon mergeEligible for GrantFox reward upon mergeStellar WaveDrips Wave contribution programDrips Wave contribution programarea:notificationsWebhook and email notificationsWebhook and email notificationsbountyBounty-eligible issue — reward contingent on program approvalBounty-eligible issue — reward contingent on program approvalenhancementNew feature or requestNew feature or requestmedium2-8 hours, requires some domain knowledge2-8 hours, requires some domain knowledge
Description
Activity
Metadata
Metadata
Assignees
Labels
GrantFox OSSGrantFox open-source bounty programGrantFox open-source bounty programMaybe RewardedEligible for GrantFox reward upon mergeEligible for GrantFox reward upon mergeStellar WaveDrips Wave contribution programDrips Wave contribution programarea:notificationsWebhook and email notificationsWebhook and email notificationsbountyBounty-eligible issue — reward contingent on program approvalBounty-eligible issue — reward contingent on program approvalenhancementNew feature or requestNew feature or requestmedium2-8 hours, requires some domain knowledge2-8 hours, requires some domain knowledge
Problem
inAppHandlerinpackages/notificationskeeps a module-level in-memory array capped at 1,000 messages. Notifications are lost on restart, invisible across gateway instances, and only reachable via package-local helpers — the dashboard has no read/read-mark API. The audit (L8) flags this as a durability/scale gap.Scope
InAppNotificationmodel topackages/database/prisma/schema.prisma(providerId, event, data JSON, read, createdAt) + migrationinAppHandlerto persist to Postgres whenDATABASE_URLis available (keep in-memory fallback for tests/no-DB)GET /api/v1/notifications(paginated, wallet-scoped) andPOST /api/v1/notifications/:id/readFiles to Modify
packages/database/prisma/schema.prismaInAppNotificationmodel + migrationpackages/notifications/src/index.tsapps/gateway/src/modules/notifications/apps/dashboard/src/app/layout.tsx/ navbarAcceptance Criteria
prisma migrate dev)pnpm exec nx test gatewaypasses