List Sync from Jira or GitLab now carries an issue's sprint and fix
versions / milestones into the board's Scrum planning while Scrum is
enabled on the board. A missing sprint or release is created on this
board with the dates the source gives; an existing one is matched by its
source ID first, then by name. A local planning change stays until the
source changes that issue's planning, and a first Sync never removes
planning. The writes go through the durable Sync journal and steps, so
an interrupted Sync is finished or discarded like any other.
Thanks to xet7 !
#4294 asked for four things. Several triggers and actions, rule variables,
renaming in place and rule import/export were built earlier; two parts were
still missing.
- "I want the assignee to be the creator of the card by default": rules had
member actions only. Add and Remove assignee actions take a username, a
{creator}/{assignees}/{members} token, the user who triggered the rule, or
"*" for every assignee, and write card.assignees. They are durable through
Sync like the member actions, with the joinAssignee/unjoinAssignee
activities the assignees hook writes.
- "give a Rule a default name": Add Rule with an empty title showed an
error, and rules.createRule stored the literal "Rule". The title is now
optional; the rule is named after its trigger and action ("When ...,
then ..."), and the rules list renames it in place.
Fixing this found that "Remove all members from the card" iterated the
card's assignees while removing from its members: an earlier fix believed
assignMember wrote assignees, but both definitions in models/cards.js write
members. It removed only members who were also assignees. Remove-all now
iterates card.members, in the ordinary and the durable path, and the guards
that pinned the wrong collection now read models/cards.js to decide.
New text is added in English, pending Transifex.
Thanks to xeruf and xet7 !
Fixes#4294.
A rule that moved a card to another board and then sent an email sent nothing:
the email source check refused a card that had left the activity's board, in
both engines. As decided, the email now reads the card on the destination
board, but only when this run of the rule made the move, the destination
opted into Sync effects, and the card is still there. The ordinary engine
remembers its run's own move (RulesHelper.emailActivity), durable Sync proves
it from a saved move of the same plan (ruleEmailActivity, ruleCardNow) and
rechecks it before sending. The stored source binding (version 6) records the
board the card left. Any other card off the board is refused as before, and
an email may now follow a move to another board in a durable plan.
Tests: binding positive and negative cases, a shape guard that nothing else
can claim a followed move, and a server test of both engines that sends once
from the destination and refuses a card nobody's run moved, a move to another
board, and a destination that opted out.
Thanks to xet7 !
The ordinary engine takes a move-all's list from the board the rule's card
is on now (RulesHelper.ruleBoards); the durable move-all onto another board
took it from the plan's board, so it could not follow a move to another
board. It now takes the list from where the card is, saves that board as
`fromBoard` - only when it is not the plan's, so saved commands still
validate - and each unit leaves from it. A move-all onto the board the card
is already on is refused. Only an email now keeps such a plan on direct Sync.
A server test moves the card from A to B, then every card of B's list to C,
durably and with the ordinary engine, with the same result.
Thanks to xet7 !
A rule whose card had been moved to another board could not move it on to
yet another one through durable Sync: the cross-board move command took
the card from the plan's board only. It now takes it from where it is -
the plan's board, or where an earlier move of the same plan took it
(ruleCardNow) - and saves that board as `fromBoard`, written only when it
is not the plan's, so every command saved before still validates. The
board the card leaves, its dependencies and the deferred hook records
follow the saved move's own before-place. A move onto the board the card
is already on is refused.
Such a further move may now follow a move to another board; every board
the chain reaches must have opted in, as the first. A move-all onto
another board still may not follow, since it moves a list of the rule's
board. A server test runs A to B to C and a later colour, durably and with
the ordinary engine on a twin card, and refuses the chain while C has not
opted in.
Thanks to xet7 !
As decided on 2026-10-03, after a rule moved its card to another board, a
later action that names the rule's own board works where the card is now,
in the ordinary engine and in durable Sync alike:
- RulesHelper.ruleBoards gives the board the card is on and the board an
action works on. A move to the top or bottom, a sort and a move-all
resolve their list and swimlane names there; the write-access check
covers that board. Before this, a move to "*" after a move to another
board took the card's new list and swimlane but the old board, leaving
the card split across two boards.
- The durable move, sort, move-all and archive commands find the card
through ruleCardNow and save the board it is on as `onBoard`, written
only when it is not the plan's, so every command saved before still
validates; the archive's cascade takes the children on that board.
- These actions may now follow a move to another board, so such a plan
stays durable. An email still may not, nor a second move to yet another
board.
The archive reservation and follower guards follow the decision; the
cross-board move test now expects sorting and archiving to follow and
refuses an email instead, and a new server test runs the whole chain
durably and with the ordinary engine on a twin card, with the same result.
Thanks to xet7 !
The ordinary rule engine reads the card by id for every action, so the
actions after a move to another board act on the card there. The
durable commands that can do the same now find the card where a saved
move of the same plan put it, and record their writes, History rows and
activities on that board: card fields, checklist toggles, adding and
removing checklists, linking, and the title variables of a new card or
swimlane. A copy refuses, as the ordinary copy does. A move to another
board is no longer required to be the plan's last action. It is lifted
when every action that can follow it in a plan, in its own rule or in a
rule of the same trigger type, is one of these. Moves, sorting and
moving all cards are resolved against the board the card left, and
archiving cascades to child cards there, so with any of those the board
keeps direct Sync.
Thanks to xet7 !
A moveAllCardsInList rule onto another board now saves one unit per
card of the list. Each unit is a whole move to another board, with the
same mappings and records as a single rule move there. As in the
ordinary action, each card keeps its sort and lands in that board's
default swimlane. Like a single move to another board, it must end its
rule plan, because the rule's own card may be among those moved. The
rule guard follows a card to where its unit put it. The single-move and
move-all runners share one apply step.
Thanks to xet7 !
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 !
A copyCard rule that copies onto another board now uses the same saved
command, with that board as its target: the copy takes that board's
labels of the same name, its custom fields as Card.copy maps them, its
card number and the dependencies that stay on it. Its checklists, items,
subtasks, comments and attachments are all placed on that board. As
with links, eligibility requires the destination to have opted in and
to have only durable rules of its own, and the runner checks it again.
The server test compares the result with the ordinary Card.copy to the
same board.
Thanks to xet7 !
As decided on 2026-10-02, a linkCard rule that links onto another board
keeps durable Sync only when that board has Sync effects enabled too and
the actor may write there. Eligibility now follows every board such a
rule reaches, because the link's creation activity runs that board's own
rules through the same stored stages; any action there without a durable
adapter keeps the source board on direct Sync. The runner checks the
destination again before each write.
A card-field rule acting on a linked card now writes the card it links
to, as the ordinary setters do through getRealId. Before, the durable
command refused a linked card, so a durable link followed by such a rule
would have failed its Sync run on every replay.
Thanks to xet7 !
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 !
An addSwimlane rule now has a saved command: the title is resolved once
by RulesHelper.ruleSwimlaneTitle, the swimlane is inserted once under an
id derived from the rule invocation, and the insert hook's
createSwimlane activity is written once, by a derived id, by the command
itself. A swimlane activity has no card, and WeKan's durable activity
delivery is keyed by a card, so that activity is delivered the way every
board-level activity is; what the command guarantees is that the
swimlane and its activity each exist exactly once across replays.
The stored-rule tests now use moveAllCardsInList as their example of an
action with no durable adapter.
Thanks to xet7 !
A linkCard rule that links onto the card's own board now has a saved
command: the linked card is built once as Card.link builds it (a copy
without id and labels, of type cardType-linkedCard pointing at the
original), under an id derived from the rule invocation so a replay
inserts it once, and its creation activity is saved and delivered
durably. The target is resolved by RulesHelper.linkCardTarget, which the
ordinary action now uses too. A link to another board keeps the board
on direct Sync.
Thanks to xet7 !
A copyCard rule that copies onto the card's own board now has a saved
command. What the copy contains is decided once, with the ordinary
copy's own helpers: the card as Card.copy builds it (the custom fields
the actor may read, its dependencies on the board, its Scrum metadata,
a new card number, the bottom of the list), its live attachments, its
checklists and items, its subtasks with their checklists, and its
comments. Every document gets an id derived from the rule invocation,
so a replay inserts each once. The copy's and its subtasks' creation
activities are saved and delivered durably; each attachment file is
copied once (copyFile can now be given the id) and its History row is
written from the stored attachment; checklists, items and comments are
direct inserts, as Card.copy makes them. The cover is remapped to the
copied attachment by its derived id. Like the ordinary copy chain
guard, a copy whose own creation triggers the same action is not copied
again. A copy to another board keeps the board on direct Sync.
The server test copies a card with all of those, replays it, checks the
chain guard, and compares the result with the ordinary Card.copy.
Thanks to xet7 !
A createCard rule now has a saved command. Its list, swimlane and title
are resolved once by RulesHelper.createCardTarget - which the ordinary
action uses too, so the two cannot drift - and the new card's id is
derived from the rule invocation, so a replay inserts it once. The
creation hook's createCard activity is known before the insert and is
saved with the command, then delivered durably, which runs the new
card's own rules. A target that does not exist is refused, as the
ordinary insert fails at its activity.
Thanks to xet7 !
A sortList rule re-sorts the cards of the rule card's list, or a named
list on the same board, and gives each card its index as its sort; the
hook records one position History row per changed card and there is no
activity. It now has a saved command: the order is decided once, by the
same sort keys the ordinary action uses (moved to the pure
models/lib/ruleSortList.js so the two cannot drift), and each changed
card is a unit written conditionally on its saved sort with its planned
position row. Replays change nothing more.
Thanks to xet7 !
The checklist lifecycle command now also covers addChecklistWithItems:
the checklist and one item per comma-separated title, both with ids
derived from the rule invocation so a replay inserts them once. After
the inserts it records, from the stored documents and in the order the
hooks write them, the checklist's activity and History row and then each
item's addChecklistItem activity and 'added' row. The item hooks are
deferred only for items of the checklist the command names. The item
titles are resolved by the same RulesHelper call the ordinary action
uses.
Thanks to xet7 !
addChecklist and removeChecklist rule actions now have saved commands,
like the other durable rule actions. addChecklist inserts a checklist
whose id is derived from the rule invocation, so a replay inserts it
once, and records the hook's addChecklist activity and History lifecycle
row from the document as it was stored. removeChecklist saves every
checklist the ordinary selector matches, one unit each, and for each
writes the removeChecklist activity before the removal and the 'removed'
History row after it, refusing a checklist that changed since capture.
The checklist hooks are deferred only for the checklist a command names.
Thanks to xet7 !
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 !
checkAll, uncheckAll, checkItem and uncheckItem join the durable rule
actions. The command is captured with performAction's own lookups - the
checklist by title on the card, the items in the order ReactiveCache returns
them, the bulk selection, and checkItem's item query as it is - so a replay
acts on the same items with the same outcome, including the ordinary
action's no-ops.
The ordinary action writes each item in turn, and the checklist item hooks
record on every write, changed or not: uncompleteChecklist before it when
the whole checklist was finished, checkedItem or uncheckedItem after it, and
completeChecklist when the whole checklist is finished - plus a History row
on the item when isFinished changed. The command simulates exactly that on
the captured items and saves one unit per item. The runner goes item by item:
the before-write activity, the conditional write with the item's three hooks
deferred, its History, its after-write activities - each delivered durably -
so a rule triggered by one item runs before the next, as ordinarily.
The History planner now accepts checklist-item rows (entity and card kept
apart), and the recording deferral can name one checklist item. Unit tests
cover the hook sequence for check-all, uncheck-all and hidden-all lists,
no-ops and tampering; a full-app test runs a "check every item" rule through
the stored rule stage - two checkedItem, one completeChecklist, two History
rows, and nothing more on replay. 566 server tests pass.
Thanks to xet7 !
addMember and removeMember join the durable card-field actions. The people
are resolved at capture exactly as performAction resolves them - the acting
user for the #2522 option, username tokens through buildRuleVars (#4294),
and the card's assignees for "remove every member" (#2674) - by a new
RulesHelper.resolveMemberTargets beside it, and saved with their usernames,
so a replay acts on the same people. The ordinary action's one $addToSet or
$pull per person becomes one planned change of `members`, with a joinMember
or unjoinMember activity for each person who really joined or left, as the
members hook writes it, and one members History row.
The new helper phrases its conditions so the source guards that locate
performAction's member branch still find it, and the recording-isolation
test now uses assignees as its example of a field that is never deferred.
Unit tests cover resolution being saved, joins and leaves, nobody resolved
and tampered targets; the full-app durable Sync test adds a member to every
created card through a rule - one joinMember activity and one members
History row. 565 server tests pass.
Thanks to xet7 !
setDate, updateDate, setDateRelative and removeDate join the durable
card-field actions. Their semantics follow the ordinary actions exactly:
setDate only fills a date that is unset, updateDate always sets it,
setDateRelative offsets from "now", removeDate unsets - with "now" fixed at
the command's capture time, so a replay makes the same change.
A full-app probe of the ordinary writes showed what they record: a dates
History row (added, edited or removed) and the timing hook's a-<field>
activity with username, card title, time key and the old value ('' when
there was none) - and no timeValue when the date is removed. The command
plans exactly that. The timing hook in server/models/cards.js gains a
'timing' deferral kind so the saved activity is written instead of the
hook's own, never both; the runner can now unset a field as well as set it.
Unit tests cover all four actions, setDate on a filled date, the timing
activity's shape for set and unset, and a replay-stable relative date; the
full-app durable Sync test gives every created card a due date through a
rule - one a-dueAt activity and one dates History row. 565 server tests pass.
Thanks to xet7 !
Boards with any rule action other than email and archive stayed on direct
Sync. Six more now take the durable path: setColor, addLabel, removeLabel,
removeAllLabels, markCardComplete and markCardIncomplete.
Each rule invocation saves one command (server/lib/syncRuleCardCommand.js)
with its card field's value before and after the action - with the ordinary
action's semantics: $addToSet/$pull for single labels, a missing field stays
missing on removeLabel, 'white' is stored as null - and the effects the
ordinary hooks would write: one History row for the field and, for
addLabel/removeLabel, the addedLabel/removedLabel activity only when the
label really changed (removeAllLabels writes none, as ordinarily). The runner
applies the saved change conditionally with ordinary History deferred for
that one write, then writes the planned History rows and activities, each
activity delivered durably with its own rules and notifications, and returns
the invocation only when all of it is confirmed. Replays use the saved
command, never the rule's current configuration.
The History planner is parameterized by allowed fields (Sync's own, or these
three), and the recording deferral covers labelIds, color and dueComplete.
Unit tests cover every action, the effects, absent-versus-null selectors and
tampering; the full-app durable Sync test labels every created card through
a rule - one History row, one activity, nothing more on replay. The rule
selection test's example of an action without an adapter is now
moveCardToTop. 565 server tests pass.
Thanks to xet7 !
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 !
The stored archive runner could be registered as the archive/unarchive
adapter, but a full-app run showed one Sync-created card archived by a rule
taking 36 seconds: each nested delivery stage re-runs every outer guard -
journal scope, intent, lease, rule and archive checks - hundreds of times.
Boards with archive rules stay on direct Sync until that guard composition
is made cheaper.
Thanks to xet7 !
The write-ahead Sync journal and its stored stages - History, activities,
rules, notifications, webhooks - were built and tested but never called:
manual and scheduled Sync wrote cards directly, so a restart mid-run lost
whatever effects had not happened yet. Maintainer decision of 2026-09-30:
finish the Scrum/Sync handoff by calling the stored stages from both.
A run now takes the durable path when it can do everything
(server/lib/listSyncSteps.js): the board enabled Sync effects (and the
instance enabled cron effects for a scheduled run), the list has a versioned
scope, and every rule action on the board - extra actions included - has a
durable adapter. Only sending email has one, so a board with any other rule
action keeps the direct writes, exactly as before; nothing that ran stops
running.
server/lib/listSyncApplication.js turns the reconcile plan into saved steps
from the stored cards, refusing a local edit made since the fetch as the
direct update would, and carrying custom fields only with a mapped estimate.
Effects are planned once with the shared planner and each step is applied
through the hooked card and activity adapters and durable delivery, as the
actor and trigger that started it. Both paths build the same new card.
A new run first finishes the list's unfinished operation, reusing the list
lease it holds instead of taking it twice. The wekan-list-sync-replay cron
job resumes interrupted operations every minute; intents now record their
trigger (version 2) so a replay runs under the same activation switches. An
operation still preparing has written nothing and is discarded - a replay has
no source data to rebuild it from.
Tests: eligibility for every condition, and step building including the
local-edit refusal (node); the direct-path suite now pins that it never calls
the durable one; a full-app run creates, updates and archives through the
journal, crashes at a card write, replays without duplicate cards or
activities, and falls back to the direct path for a rule action without an
adapter. 565 server tests pass.
Thanks to xet7 !