4 Commits
Author SHA1 Message Date
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 f06ecdee09 Share guard results within one check, and make rule archive a durable Sync action.
Stored Sync stages nest - a rule archive's delivery inside the rule stage,
inside activity delivery, inside the Sync journal - and every layer's guard
checks before and after by calling the guard below it twice. One innermost
check therefore re-ran every outer guard 2^depth times, and one Sync-created
card archived by a rule took 36 s, which is why archive was held back from
durable Sync (1e40e7e06).

reuseWithinEvaluation (server/lib/syncGuardWindow.js) runs each guard at most
once per evaluation: calls made while another guard's check is running share
the results of guards already checked in it. A call from ordinary work -
between stages, after an adapter or a write - starts a new evaluation and
checks everything afresh, so a policy change or a lost lease between stages
still stops the next one. A first attempt with a 100 ms reuse window missed
exactly that and was dropped. Failures never carry over, a guard reached
again through its own check runs fresh instead of waiting on itself, and the
journal's ownership read is left as it was.

With that, archive and unarchive are registered as durable rule adapters
through the stored archive runner, and boards whose rules archive or
unarchive now take durable Sync. The full-app durable Sync test runs an
"archive every created card" rule end to end: 1.1 s for the whole test. The
rule selection test's example of an action without an adapter is now
moveCardToTop. 565 server tests pass.

Thanks to xet7 !
2026-09-30 11:50:04 +03:00
Lauri Ojansivu 24536f6cbd Keep Sync's rule, notification and webhook effects off unless enabled.
Maintainer decision of 2026-09-30: running rules, notifications and
webhooks for changes that Sync makes is off by default. A board opts in
with syncEffectsEnabled, and scheduled runs additionally need the new
instance flag enableSyncCronEffects, so an upgrade changes nothing on
its own. Every stored-effect stage (rules, rule email and archive,
notifications, webhooks) now requires its caller to name the trigger,
manual or scheduled, and checks both switches inside its guard with the
board it re-read, so whatever later wires Sync to these stages cannot
skip them. The switches have no interface yet: the stages are not
called by Sync until the History coordination they wait on is done, and
a toggle that does nothing would mislead.

tests/syncActivation.test.cjs pins the decision, the defaults and that
each stage checks it; the full-app suite refuses a missing trigger, a
board that has not opted in and a scheduled run without the instance
switch, writing nothing, then succeeds once both are on. 560 server
tests pass.

Thanks to xet7 !
2026-09-30 02:00:42 +03:00
Lauri Ojansivu cc9a568c76 Coordinate stored Sync activity delivery with exact stage receipts 2026-09-28 15:17:30 +03:00