Commit Graph
4 Commits
Author SHA1 Message Date
Lauri Ojansivu 32d1abeffe Make rule moves to another board durable when both boards opted in.
A moveCardToTop or moveCardToBottom rule onto another board now runs its
saved command. The card is updated once, conditionally, with every hook
record deferred, and each record is written from the command: History
rows, the legacy undo row, re-homed checklists, the dependencies left
behind on the old board, attachment placement, re-pointed label
activities, the moveCardBoard activity and the custom-field activities.
The server test compares the result with the ordinary Card.move.

Every other durable command acts on the card on the plan's board, so
such a move must end its rule plan. The command refuses any other
position before writing anything. Eligibility counts the move only when
it is the last action of its rule and no other rule on that board fires
on the same activity type; the destination must have opted in too.

The rule guard follows the card to the board this plan moved it to. The
activity's notification and webhook stages judge recipients on the card
as placed for the activity. Before, they refused a card that a rule had
moved, which would have failed any run whose moved card had a watcher
or a webhook, also for moves on the same board.

Moving all cards of a list to another board stays on direct Sync.

Thanks to xet7 !
2026-10-02 19:10:32 +03:00
Lauri Ojansivu d82a54944a Finish a durable Sync run whose rule moved or archived the card it synced.
A Sync step's rules run after its card write, and since rules may move a
card to another list or archive it, the card can afterwards match
neither the step's before-state nor its after-state. Two things then
failed:

- An interrupted run never recovered. The replay retried the step's
  write, which could not be confirmed, so the run failed on every replay.
  The journal now treats a stored planned activity as proof that the
  write happened (activities are stored only after it is confirmed) and
  finishes the effects, which are idempotent.
- Even an uninterrupted run failed whenever a durable rule moved the card
  out of the list. The activity's notification and webhook stages ran
  after the rule and refused a card that was no longer in the activity's
  list. They now also accept the card where a saved move of that
  activity's own rules put it, and nowhere else.

A failed replay now logs why. The durable Sync server test runs a rule
that moves each new card out of the synced list, crashes after the move,
and checks that the replay completes the run with one move.

Thanks to xet7 !
2026-10-02 18:19:02 +03:00
Lauri Ojansivu 9cc42caac9 Make rule moves to another list or swimlane, and move-all, durable on the card's own board.
The rule stage's guard now accepts the card where a saved move of the
SAME rule plan put it (maintainer decision of 2026-10-02), so the rule's
later actions act on the moved card once. Each move is a saved command
with Card.move's effects: the update, the position History row, the
legacy undo row, the attachments' placement and the moveCard activity.
moveAllCardsInList saves one unit per card. Moves, copies and links to
another board stay on the direct path.

Thanks to xet7 !
2026-10-02 17:53:05 +03:00
Lauri Ojansivu b3b4962414 Run rule moves to the top or bottom of the card's own list through durable Sync.
A moveCardToTop or moveCardToBottom rule whose list and swimlane are '*'
on the card's own board only changes the card's sort. It now has a saved
command, like the card-field actions: the sort is computed once at
capture as the ordinary action computes it, the write is conditional on
the saved sort, the hook's position History row is planned and written
once, and the legacy UserPositionHistory row that Ctrl+Z reads is
written once with trackChange's redo-stack clearing. Replays apply the
saved command and change nothing more.

A move to another list, swimlane or board is reported to eligibility as
'<type>:elsewhere', so a board with such a rule keeps direct Sync.

Thanks to xet7 !
2026-10-02 15:34:18 +03:00