feat: push notification when a shared shopping list is updated

Shared shopping lists (owner + collaborator-invite members) had no
real-time coordination signal — no way to know someone else just checked
off milk or added items while you're mid-aisle. Notifies every other
member (excluding the actor) via push when an item is checked off or
items are added; no-op for solo unshared lists.

Deliberately skips the notifications table/notification-center (same
pattern as the existing leftover-expiry cron) — this is a lightweight
best-effort ping, not a persistent event, so it avoids a notification_type
enum migration and a new FK column for something transient.

Verified locally: added a real member to a shared list, registered a
push subscription, confirmed the check-off request's added latency
(945ms vs ~20ms baseline) shows the actual webpush call fired against
the recipient — individual subscription failures are swallowed by design
(Promise.allSettled in the existing sendPushNotification, unchanged);
confirmed a solo list stays fast (no recipients to notify, true no-op).
This commit is contained in:
Arnaud
2026-07-12 18:36:20 +02:00
parent 9566e19cd0
commit aa6bd03c5e
5 changed files with 112 additions and 4 deletions
+5 -2
View File
@@ -41,7 +41,9 @@
"detail": {
"comment": "{name} commented on your recipe \"{title}\"",
"rating": "{name} rated your recipe \"{title}\" {stars} stars",
"leftoverExpiring": "Your \"{dish}\" from \"{title}\" is about to expire — eat it soon!"
"leftoverExpiring": "Your \"{dish}\" from \"{title}\" is about to expire — eat it soon!",
"shoppingListChecked": "{name} checked off \"{item}\" in \"{list}\"",
"shoppingListItemsAdded": "{name} added {countLabel} to \"{list}\""
},
"pushTitle": {
"follow": "New follower",
@@ -50,7 +52,8 @@
"reaction": "New reaction",
"rating": "New rating",
"mention": "You were mentioned",
"leftoverExpiring": "Leftovers expiring soon"
"leftoverExpiring": "Leftovers expiring soon",
"shoppingListUpdate": "Shopping list update"
}
},
"recipe": {