5 Commits
Author SHA1 Message Date
Lauri Ojansivu e85eaa3ad3 Sync notifications are planned again with the clear e-mail layout.
v12.44 made the clear HTML layout the default for notification e-mail
(#4434), and with it every e-mail job carries `text`, its plain-text part.
The Sync notification plan validator accepted exactly seven job fields, so
it refused every plan: a rule or Sync run's notifications failed with
sync-notification-plan-invalid. groupKey and deliverAt, from non-default
delivery settings, were refused the same way before that.

The validator now takes what emailOutbox.enqueue takes - the seven fields
and the three optional ones, checked as enqueue checks them - so a plan
never holds a job its replay would refuse. tests/syncNotificationPlan
.test.cjs plans a job with all three and refuses bad ones, and pins that
the optional list is exactly enqueue's parameters; the full Meteor run
found it (Shared notification preparation, Stored Sync notification
delivery).

Thanks to xet7 !
2026-10-14 17:48:45 +03:00
Lauri Ojansivu 2df3e9a8b7 Deliver board-level activities durably: a rule's new swimlane and cross-board moves.
Durable delivery identified every activity by a card and a list, so a
rule's createSwimlane activity, which names neither, and a cross-board
move's moveCardBoard activity, which names no list, were written once
but delivered the ordinary way: their notifications and webhooks were
not replayed after a crash. Durable delivery now takes activities
without a list, and without a card. Recipients and webhook senders are
checked against the board, plus the card when one is named. A card or
list the activity does not name is refused. An assigned-only member
never receives a board-level event, since its scope cannot be checked
against their assignments. The rule stage has nothing to run for these
types, because no trigger exists for them, and it refuses a list-less
activity whose type has one.

Thanks to xet7 !
2026-10-03 00:08:13 +03:00
Lauri Ojansivu bb591c448a Compact delivered Sync notification plans after 90 days.
Maintainer decision of 2026-09-30: receipts are compacted after 90 days to a
permanent minimal id and outcome, notification plans included. A stored Sync
notification plan keeps every recipient's rendered subject and HTML, and had
no completion evidence of its own, so it could never be told finished and
was kept forever.

Delivery now writes a receipt once it is confirmed - planId, activity hash,
plan checksum and completedAt; the first stored receipt wins. After
SYNC_RECEIPT_METADATA_DAYS (90) an hourly sweep replaces the exact plan the
receipt was written for with { _id, activityHash, checksum,
compactReceiptVersion } in place, so its id stays taken. A replay that finds
the compact form returns as delivered and never rebuilds or resends; within
the period a replay still re-checks every recipient, as before. A compact
plan without its matching receipt, or for changed activity content, is
refused.

The other receipt rows named in the decision - Scrum completions and
requests, Sync operation intents and completions - already hold only ids,
hashes and timestamps, so there is nothing in them to compact.

MongoDB tests cover what is compacted and what is not, idempotence, replay
of the compact form and the refusals; the full-app delivery test compacts a
real delivered plan and replays it without sending.

Thanks to xet7 !
2026-09-30 11:12:25 +03:00
Lauri Ojansivu 2ae279838d Share ordinary notification audience selection with saved delivery preparation 2026-09-28 05:07:25 +03:00
Lauri Ojansivu 276675bc7f Persist frozen notification plans and resume tray and email enqueue stages 2026-09-28 05:00:34 +03:00