Commit Graph
228 Commits
Author SHA1 Message Date
Lauri Ojansivu d06b468629 Tests: ReplyBleed's mocha test counts the attempt in every ReplyBleed row.
ReplyBleed is one Problems row per source, and the webhook's source is the
client address, so the bounce and board-address tests leave rows of their
own in the test database, which persists between runs. The test's findOne
picked one of those (source "ses"), whose count the spoofed reply never
moves, and failed although the attempt was recorded under 127.0.0.1. It sums
the count over all ReplyBleed rows, the way emailBounces.tests.js already
does.

Thanks to xet7 !
2026-10-29 23:07:04 +02:00
Lauri Ojansivu ebcd02be6f Hall of Fame regression audit: every fixed vulnerability still fixed, siblings of six of them closed.
Every Hall of Fame vulnerability without a test naming it (24 names, 30
advisories) was checked against the current source. No fix had been
reverted. Looking for the same mistake elsewhere found siblings:

- FloppyBleed: the fs-path-heal upgrade step joined an attachment's
  stored name into candidate paths as-is; a record a client inserted
  named ../../../etc/passwd made the next upgrade copy that file into
  storage - an arbitrary file read. Only the name's last component is
  used now; the bulk move limits a legacy name's extension the same way.
- FilePathBleed (GHSA-g6vm-7757-pr88): the insert guard looked only
  inside versions; with versions left out ostrio:files falls back to a
  top-level path, which removing the record deletes and validation
  reads. A client's top-level path is refused for attachments and
  avatars, recorded by the existing canaries.
- MoveStorageBleed: validateAttachment, which deletes a file failing the
  current upload rules, was open to anybody who could see the board, a
  public one included. Only who may change the file, or a site admin,
  validates now; a refusal is recorded (authz.attachment-validate).
- HookUrlBleed / IntegrationBleed: the REST reads of a board's
  integrations gave the webhook URL - whose path is its secret - to
  every member reading the board; non-admins get what the publication
  gives them.
- AttachmentMigrationBleed: four migration methods answered any
  logged-in user about any board, deleteDuplicateEmptyLists.getStatus
  with a private board's list titles; they require a visible board and
  record refusals (authz.migration-board).
- LegacyAttachBleed (GHSA-xcxp-hx9w-q5q9) and MimeStorageBleed
  (GHSA-rv5g-5p4g-3v89): the legacy route judged a name dangerous only
  for .svg, the response policy missed x-javascript, ecmascript, xsl and
  +xml types, and the sniffers missed <tag/onx= handlers.

OIDCBleed refusals are now recorded in Admin Panel / Problems too. New
suites name the vulnerabilities they guard, existing ones name the
advisories they already covered, and tests/securityRegressionCoverage
counts 128 of 137 published vulnerabilities with a named test (was 125).

Thanks to xet7 !
2026-10-27 16:28:12 +02:00
Lauri Ojansivu 4bd6a7f088 Dragging a checklist item on one's own board is no longer reported as a cross-board attack.
Dragging a checklist item within its card sets cardId and checklistId
to where the item already is. The ChecklistBleed deny rule
(GHSA-gv8h-5p3p-6hx7) checked only that the destination board was
writable, so for a comment-only member or a Worker - whose own board is
one they cannot write to - an ordinary drag tripped the high-severity
canary checklist-item.cross-board-move and named them in Admin Panel /
Problems / Security as if they had attacked another board.

The board the document is already on is no destination now. That board
is the one of its SOURCE CARD, which the allow rule decides on - not
the document's own denormalized boardId, as the reporter's patch read
it: the insert hooks kept a boardId the client sent, so an item on the
attacker's card could carry a victim board's id and would have passed
as staying while moved onto a victim card. Those hooks (checklists,
checklist items, and now text notes on the server) set boardId from the
card always. A move to another unwritable board, and an unknown
destination, are still denied and still reported.

Thanks to Raymond-Voogt and xet7 !

Fixes #6813.
2026-10-27 14:52:06 +02:00
Lauri Ojansivu 1020cd7e86 Custom roles apply in every board view: verified, tested and documented.
A custom role from Admin Panel -> People -> Roles reaches every board view
through the same two questions as a built-in role: what the member may do is
asked of the capability table, which answers from the custom role, and which
cards they see is asked of the member's flags, which the custom role writes.
fallbackRoleFor() picks only among built-in roles that see no more cards, so
a role whose "Sees all cards" is off always mirrors an assigned-only role and
one with it on never does. The flags are written when a member gets the
role, rewritten on every board when the role is saved, replaced with the
custom role by setMemberPermission, and kept when the role is deleted; no
other code writes them.

tests/boardRoleViews.test.cjs builds a member for all 32 capability
combinations as the server writes it and checks that the card scope, the
card rule, REST reads and writes, button rules and the real Email View
selector narrow them exactly when the role does not see all cards, and that
nothing sets a role flag without the custom role following.
server/lib/tests/customBoardRoles.tests.js turns "Sees all cards" off and on
for a role in use and checks its member becomes assigned-only and back
(meteor test; not run here). docs/Features/Members/Roles.md explains it in
"Custom roles in every board view".

Thanks to xet7 !
2026-10-16 15:23:16 +03:00
Lauri Ojansivu 5b2ed17e6b Board role permissions apply to every board view and every path to a card.
AssignedBleed follow-up, GHSA-r4gm-mjj9-g3x8. An assigned-only member
(isNormalAssignedOnly, isCommentAssignedOnly, isReadAssignedOnly, and custom
roles through those flags) sees only the cards assigned to them. The Board
Email View checked board.isVisibleBy() alone, so it published the title,
description and email metadata of every card in a list or label, counted
them, and searched them. It now merges assignedOnlyCardScope into its folder
and search selector for the page and the count, and a reply on another card
is refused.

An audit of every path that returns or changes a card found the same shape -
"a member of the board, so every card of it" - elsewhere, all fixed here:

- reads: the board publication's ancestor cards, linked source cards with
  their subtasks and dependency targets, and comment reactions; All Boards
  tile counts; a board's activities from linked boards; the Chat view and
  the All Boards feed, which also let card MEMBERS through (assignees is the
  rule); My Attachments' card; GET /api/user/cards; position history of a
  card; the cross-board subtask picker; Scrum rollover counts; and the
  notification publications, which kept sending the full documents of cards
  named in old notifications - also to members removed from the board;
- writes on a card the member cannot see: the canonical
  canEditCardOrLinkedCard / editableCardIds (every Cards.allow update,
  checklists, items, attachments, text notes, custom fields, the shared
  description, card methods) now ask the card - the role's `write` is a
  board answer, and the card is read when a caller passed it without
  assignees; DDP and REST comments, button rules on a card, checklist moves,
  issue state, watching, the card-opened webhook, moveBoardObjects,
  moveSwimlane and attachment moves;
- REST writes: checkBoardWriteAccess refuses assigned-only members, as
  checkBoardAccess already does for reads - those routes act on any card,
  list or swimlane by id. The GHSA-f396 canary still fires for a role
  without the write capability.

A refusal no view would produce is recorded under AssignedBleed in Admin
Panel -> Problems (authz.assigned, medium: never disables); opening a view,
searching and REST calls are narrowed or refused without a record.

tests/boardRoleViews.test.cjs runs the Email View selector, pins every path
above, and fails when any server file that serves card data has no role
rule and no stated exemption; the "assignee or card member" rule is
rejected anywhere in server/ and models/. server/lib/tests/editableCardIds
adds an assigned-only case for both edit checks (meteor test; not run here).
Seven guards that pinned the old lines now pin the new ones.

Thanks to crypto-nidh, binary-lover and xet7 !
2026-10-16 13:03:34 +03:00
Lauri Ojansivu 51238ed8ad Import: attachment files of Jira, Nextcloud Deck, OpenProject, Asana and GitLab.
Their exports name attachments without carrying the files, so the files
were reported as a loss. Each service documents where a file is
downloaded, behind the same sign-in as its API:

- Jira: fields.attachment[].content (/rest/api/3/attachment/content/<id>),
  Basic email:API token; Jira's redirect to its media store is followed
  without the sign-in.
- Deck: /index.php/apps/deck/api/v1.0|v1.1/boards/../stacks/../cards/..
  /attachments/<id>, Basic user:app password, OCS-APIRequest: true.
- OpenProject: _links.downloadLocation, relative to the instance, Basic
  apikey:<key>.
- Asana: GET /attachments/<gid>?opt_fields=download_url with a personal
  access token, then the signed download_url without it; a file the
  export embeds (export_boards.pl) is taken as it is; one kept on Google
  Drive and the like is a link, reported.
- GitLab: a private project's /uploads/ link through
  /api/v4/projects/<id>/uploads/<secret>/<file> (17.4+), Bearer token.

The import page asks for the address, user and token under "Attachment
files" for these five (the REST import takes the same as attachmentAuth).
They go with that one import: held beside the creator in a WeakMap, never
stored or logged, the token field emptied on Import, and sent ONLY to
the origin the member typed - an export names any URL it likes. Every
download is the import's SSRF-guarded fetch, which validates each hop
and drops Authorization on a cross-origin redirect. A file that cannot
be fetched is on the loss report with its reason. Unticking Attachments
leaves them out (Jira's per-issue field is pruned too).

Zenkit is left out: it publishes no way to download a file.

Tests: importAttachmentAuth.test.cjs (each service's request, the
sign-in only to its origin, malformed sign-ins, never stored or
logged), the parser tests pin the attachment lists, a Meteor test
imports an embedded Asana file onto its card and shows a Jira file is
reported without a sign-in and that the sign-in never reaches an address
the guard refuses, and import-attachment-auth.e2e.js the page (not run
here). Not run against the live services.

Thanks to xet7 !
2026-10-15 01:27:26 +03:00
Lauri Ojansivu cc0b8c60ba Jira import: closed sprints, rebuilt from the issues.
Jira's sprint report has no documented API, so a closed sprint was
reported and skipped. It is now imported as closed, with its start and
close snapshots rebuilt from documented issue data: the Sprint field,
status and resolution at the sprint's start and completion dates, from
each issue's change history (expand=changelog), or from the issues as
they are now when there is none. The snapshots are marked partial. A
closed sprint with no start or completion date is still reported.

Thanks to xet7 !
2026-10-15 00:46:39 +03:00
Lauri Ojansivu 2ee3e83793 Chat view: channels are the cards with a conversation, on every board, with unread counts.
The Chat view's tree listed the open board's swimlanes, lists and cards,
and every other board as a link that left for that board. Now:

- The tree is workspaces > boards > swimlanes > lists > cards, holding
  the cards that have a conversation on every board the member sees
  (server/chatView.js chatViewChannels). Every board without one is under
  Other boards; its first message moves it up to its place.
- Each level has a caret before its icon - after it, mirrored, in a
  right-to-left language - and folds open and shut with a slide (none
  for a member who asked for reduced motion). Clicking a board folds it;
  it no longer leaves the Chat view. The board the member is on, its
  workspaces, swimlanes and lists start open; what they open or close is
  kept in their browser.
- The board the member is on shows all its cards, from the board's own
  data, so a conversation can start on any card and a dragged card moves
  in the tree at once; its button shows only the cards with messages.
  Another board opened from Other boards shows all its cards
  (chatViewBoardChannels) for the same reason.
- Every level shows the messages this member has not read: others'
  messages after they last opened the card, all of them on a card never
  opened; opening the card - or a message arriving while it is open -
  reads it.
- Every name, and the chat's header, renders as Markdown (inlineViewer).
- Only what the member may read: boards they see in All Boards, only
  their own cards on an assigned-only board, no conversation where their
  role reads no comments.

Tests: tests/chatView.test.cjs (the tree, Other boards, a first message
moving a board up, unread sums, the full board, carets, folding rows,
no navigation), server/lib/tests/chatViewChannels.tests.js (unread
counts, never my own, the role and assigned-only limits, a board I do
not see refused), email-chat-views.e2e.js (folding without leaving the
view, the move up, unread badges, Markdown names). New strings
translated in all locales.

Thanks to xet7 !
2026-10-14 23:08:22 +03:00
Lauri Ojansivu 5fee137f01 Tests: three guards follow the History fork and GitLab write-back fixes.
- syncHistoryAdmission pinned the line that walked successors to the
  chain's tip inside appendSyncHistoryRow; 66dd9b0938 moved that walk to
  historyChainTip and made the append take turns, so it pins those.
- The write-back's injectable GitLab read was a parameter named fetch,
  which syncBleed's "no new platform fetch()" guard rightly could not
  tell from the real one; it is readIssues now.
- syncClosedByWeKan, the card field the write-back added, is in the card
  e-mail field inventory as internal provenance, excluded like the other
  sync fields.

Thanks to xet7 !
2026-10-14 22:56:34 +03:00
Lauri Ojansivu d6c1d6fce1 List Sync: write WeKan's changes back to GitLab.
#2698. A list synced from GitLab gets a Sync option of its own, off by
default: Write changes back to GitLab. With it, every Sync run first
sends what members did on the list's cards, then reads GitLab, so the
read finds both sides agreeing:

- a title or description edited in WeKan, when the issue still has the
  text both sides last agreed on - the local-only edit the reconcile
  already keeps. The Source footer Sync adds is not sent; when both sides
  changed, nothing is written and it stays a conflict to resolve;
- a card archived in WeKan closes its open issue, and restoring a card
  WeKan closed reopens it (syncClosedByWeKan); an issue GitLab closed is
  never reopened by WeKan;
- a comment written in WeKan becomes a note, and keeps the note's id
  (syncCommentId) so the comments sync does not bring it back twice.

Only what happens after it was switched on is sent (writeBackSince), at
most 100 writes a run. Every write is fenced by the list's Sync
reservation, goes through the same address checks as the reads (no
redirects, PUT or POST to an issue or its notes only), and records on
the WeKan side only while the card or comment is still as planned. A
refused write is shown in the Sync popup (syncWriteBackError, beside
syncSource because the run's list writes match syncSource whole) and the
read sync still runs. Not in Sandstorm, whose bridge only reads.

Tests: tests/listSyncWriteBack.test.cjs (the plan with GitLab's shapes,
the parser's footer, every negative - conflict, legacy card, old
archive or comment, foreign card, issue GitLab closed - and the wiring),
server/lib/tests/listSyncWriteBack.tests.js (end to end through
syncOneList against a fake GitLab). The live test,
releases/live-tests/gitlab-write-back.mjs, runs from build.sh / build.bat
-> Tests -> Live tests with the glab login releases/mirror.sh uses, on one
scratch issue in a private project of that account; it is human-run and
was not run here. releases/live-tests/run.mjs runs every live test and
skips a service with no login.

Also: the English variants get the SQRL and Windows sign-in strings
(their key order follows en.i18n.json); buildScriptParity accounts for
the scripts CI runs inside their own environments; new strings
translated in all locales.

Thanks to xet7 !
2026-10-14 22:08:34 +03:00
Lauri Ojansivu 5e671c7034 Scrum: batch undo and redo of a large sprint is 2.6 times faster.
Undoing a 10,500-card sprint close took 282 s and redoing it 578 s, about
27 ms a card: each record of a History row cost some thirty database
round trips - a read per record in the preflight, two ownership checks
(two reads each) around every read, the same again around a readback
after every write, and the whole row read back record by record twice
more at the end.

Now a row's records are read in one query per type (readTargets), and
inspectScrumHistoryWrites takes that as readMany, bracketed by one
ownership check before and one after: the worker's claim and the source
row only ever go from current to displaced, so current before and after
the read means current throughout it. Every write keeps its ownership
check right before it, after the read it is computed from; the readback
after a write confirms the value landed and leaves ownership to the next
write's fence and the batch's final readback. A sprint or release that
thousands of cards name is looked up once, not once a card. The
permission check stays per card.

The 10,500-card start / close / undo / redo test went from 14 min 27 s
to 6 min 7 s on the same machine; all 18 Scrum tests pass.
tests/scrumHistoryWriteState.test.cjs pins one read and three checks
for a bracketed read, ownership lost during it, a short answer, a missing
record and identities checked before any read (negative), and that every
write in the path is still fenced after its read.

Thanks to xet7 !
2026-10-14 21:45:54 +03:00
Lauri Ojansivu ea9007d8a8 Scrum: the 10,500-card test gets the time it takes, measured.
It timed out in every full Meteor run. Profiled at full size it passes, in
15 min 25 s: start and close 2 s, the rollover 36 s, the undo batch 282 s
and the redo 578 s - past the 15 minutes it had. The next test, which
interrupts a rollover, then met this one's unfinished writes and failed
too. The test has 30 minutes now, with the measurements beside the
limit, and the Scrum snapshot rows group passes (3 passing, 14 min).

TODO Later now records the real follow-up: batch undo/redo writes about
27 ms a card.

Thanks to xet7 !
2026-10-14 20:10:07 +03:00
Lauri Ojansivu 25d906d93c attachmentApi test: the upload-limit refusal no longer times out.
It failed in every full Meteor run, before this round too, at Mocha's two
seconds. Timing the handler showed it refuses in 2 ms; the time was its
console.error of the refusal - the first error stack of the run, whose
printing loads the server bundle's source map. The test now captures that
log (and checks it was written) instead of printing it, and the group runs
in under half a second.

Thanks to xet7 !
2026-10-14 18:53:37 +03:00
Lauri Ojansivu c940b3e301 Sign in with SQRL, from a phone or a computer.
SQRL (https://www.grc.com/sqrl/sqrl.htm) signs in with a SQRL app or client
instead of a password. A site admin turns it on in Admin Panel -> Settings,
off by default; WeKan must be at an https:// ROOT_URL. A member adds their
identity once in Member Settings -> SQRL, by scanning the QR code or
opening their SQRL client; the sign-in page then offers Sign in with SQRL,
shows the sqrl:// link and its QR code, and signs in by itself once the
client has answered. With the client on the same computer (cps), the
client opens WeKan with a one-time token instead.

The protocol is GRC's SQRL Semantics: the client posts signed requests to
/sqrl, each verified with Ed25519 by Node.js's own crypto, no new
dependency for it. Every nut is random and used once, taken atomically;
each request must carry the server's previous reply unchanged; a request
from another address than the sign-in page's is refused unless the client
says noiptest; disable needs the identity's signature, and enable, remove
and rekeying need the rescue code's unlock key. An identity WeKan does not
know can neither make an account nor sign in. The page learns of success
by polling with a secret only it holds, and signing in uses that once.
The identity's public keys are a user field never published and not
writable from the client. Not offered on Sandstorm. sqrlonly and hardlock
are not supported. The QR code is qrcode-generator 1.4.4 (MIT, pinned).

models/lib/sqrl.js is the protocol with storage and signature check passed
in; tests/sqrl.test.cjs drives it with a software SQRL client using real
Ed25519 keys - adding an identity, the waiting page, cps, another network,
forged signatures, replayed nuts, altered replies, unknown identities,
another member's identity, disable/enable, rekey and remove - and pins the
server's single-use and visibility rules and the UI.
server/lib/tests/sqrl.tests.js runs in Meteor (2 passing): off by
default, then an identity added and signed in with once, through the real
/sqrl route and MongoDB. Documented in docs/Features/Login/SQRL.md. The
new strings are English placeholders until the translations that follow.

Thanks to xet7 !

Fixes #2460.
2026-10-14 17:02:20 +03:00
Lauri Ojansivu 0a5ae3e205 Browser push notifications, per device.
Member Settings / Notification Settings / "Browser notifications on this
device": the browser asks for permission and gives a push subscription,
and from then on every notification the member gets in WeKan - the same
recipients, watching and muted kinds as the tray and e-mail - also pops
up from that browser even with WeKan closed; a click opens the card. Turn
it on per browser and device, up to ten per account.

web-push 3.6.7 (pinned) sends it with this WeKan's own VAPID key pair,
made once and kept in a server-only collection; only the public key
leaves the server. A subscription's endpoint is chosen by the browser and
POSTed to by the server, so it is accepted only over https and only at
the push services browsers use - an internal address or another site is
refused when saved and again before every send. Gone subscriptions are
forgotten. The service worker opens only paths of this WeKan. Not
offered on Sandstorm.

models/lib/webPush.js decides; tests/webPush.test.cjs covers the push
services, internal and look-alike hosts, foreign click targets and the
bound; server/lib/tests/webPush.tests.js runs in Meteor (passing): one
key pair, only the public key out, an internal endpoint refused. With
the webhook activity picker (c3321926ab) and the all-boards activity
feed (656af74b2c), this completes both issues. The new strings are
English placeholders until the next translation pass.

Thanks to saurabharch, hingerl and xet7 !

Fixes #2026,
Fixes #1377.
2026-10-14 15:44:01 +03:00
Lauri Ojansivu 63ef900d56 Passkey (WebAuthn) login, and Log out everywhere.
Member Settings gets Passkeys: add a passkey on this device under a name,
see the account's passkeys and remove one. The sign-in page gets "Sign in
with a passkey": the browser offers this WeKan's passkeys, no user name
needed. Verification is @simplewebauthn/server 14.0.3 (MIT, pinned)
against ROOT_URL's host and origin, so a passkey cannot sign in to another
site or through another address; each sign-in signs a fresh challenge
that is used once and expires in five minutes, and the signature counter
must move forward, so a copied passkey is refused. A disabled account
cannot sign in with one (the existing validateLoginAttempt hooks apply).
Passkeys are a top-level user field, never published and not writable
from the client; up to 20 per account. Not offered on Sandstorm.

Member Settings also gets Log out everywhere: after a confirmation every
login token of the account goes, so Meteor ends every session - other
browsers, phones, the desktop app - and this one. Nothing else changes.

models/lib/passkeys.js holds the relying party, base64url and the
browser conversions; client/lib/passkeys.js uses navigator.credentials
directly. tests/passkeys.test.cjs signs assertions with a software ES256
authenticator: a real signature verifies, and another key, another
origin, another challenge or a counter that went back are refused; it
also checks single-use challenges, the unpublished field and the pin.
server/lib/tests/passkeys.tests.js runs in Meteor (2 passing): the module
bundles, login options name no account, and registration needs a user.
Documented in docs/Features/Login/Passkeys.md. The new strings are
English placeholders until the next translation pass.

Thanks to xet7 !

Fixes #5847.
2026-10-14 14:59:25 +03:00
Lauri Ojansivu e0317a9ff3 Drain the activity notification recovery list; index synced-cron's lookup.
#6768: the recovery scan retried every pending activity notification each
round, and one whose delivery fails for good - its activity deleted or
changed since, a recipient who lost access, a plan with nothing or too much
to send - failed the same way every round, forever, so the list only grew.
Such an error is terminal now: after a ten-minute grace (an activity being
written is never touched) the scan cancels that notification through the
same cancellation an administrator uses, as the system, which compacts it
to a cancelled receipt. A pending notification older than
ACTIVITY_NOTIFICATION_MAX_AGE_DAYS (7) is cancelled as expired instead of
being delivered a week late. Network and other transient failures are still
retried. Admin Panel -> Problems gets "Retry all" and "Cancel older..." for
the whole list at once, site administrators only.

#6769: before each run synced-cron asks whether a job of that name is still
running - { name, finishedAt: { $exists: false } } - every minute for every
job on every instance, and only { intendedAt, name } and the TTL on
startedAt were indexed, so it scanned the job history. { name, finishedAt }
is created at startup with WeKan's ensureIndex.

The new strings are translated in every locale.

Thanks to Raymond-Voogt and xet7 !

Fixes #6768,
Fixes #6769.
2026-10-14 14:00:21 +03:00
Lauri Ojansivu aa48a2b71d Board Settings / Bots: hand cards to external runners, as kanbots does.
Board Settings -> Bots, below Workflow view, is the Rules page's view for
bots: runners on your own server - an AI agent, a CI job, a script - that
the board hands cards to. It is laid out like kanbots in the board's own
theme, Font Awesome and drag and drop: a rail of bots, live runs and
activity; the board's lists as columns, each card with its run's state
(Queued, Running, Waiting for you, Ready to review, Done, Failed, Stopped),
the step it is on and the answers to a question it asked; and a drawer with
the card's thread, Hand to bot, Stop and a reply box. Board admins only,
like the rest of the Rules page, and never a board or public view.

A bot has no rights of its own, like Rules and workflows. WeKan only sends
to it: a bot is an outgoing webhook marked as a bot, subscribed to no board
activity and no reminders, and a dispatch goes through the ordinary webhook
queue - the SSRF guard, its signing token, retries, Sandstorm's Powerbox.
The runner works on the board through WeKan's REST API with its own user's
token and board role, and reports its run at one REST route that needs
write access to the board. Handing over is a board admin's choice, in the
view or with the new Rule action "Hand the card to bot"; an answer or a
reply is the admin's own comment, under their right to comment.

The GitHub- and Gitea-compatible APIs' routes are regular expression
literals now, and an instance board is Trello's "org" level.

The new strings are translated in every locale.

Thanks to xet7 !
2026-10-14 13:39:18 +03:00
Lauri Ojansivu d0378f33c2 Give old boards their keys in one pass, not one query per board.
v12.41 gave every board without a key one at startup by re-reading every
key of the instance for each board, and counting up from 2 again for every
board that shares a title: quadratic, and on 32,500 boards hours of slow
`{ key: { $exists: true } }` queries. Now the keys in use are read once,
the new keys are planned in memory with a counter per base
(models/lib/boardKey.js planBoardKeys, linear), and written in batches of
1000, each only where the board still has no key, so a key a board admin
set meanwhile is never replaced. A single new board reads only the keys
that could collide with its suggestion (an index range on the new `key`
index), not all of them. Planning 32,500 boards takes well under a second;
600 boards are written in under one on a running server.

Thanks to Raymond-Voogt and xet7 !

Fixes #6767.
2026-10-14 13:13:55 +03:00
Lauri Ojansivu 86ec72fade Optional APIs: Trello, Jira, GitHub and Gitea compatible, off by default.
Admin Panel / Settings / Visibility / Optional APIs ticks REST APIs in the
shape of Trello's, Jira's, GitHub's and Gitea's, so apps and scripts written
for them - Trellinator, Jira and GitHub clients - can use WeKan as their
backend, each described on the page with the address a client uses.

None has rights of its own. Each is a translator: a request in the other
tracker's shape becomes the matching request to WeKan's own REST API, made
with the caller's own WeKan token on the loopback address, and the answer
becomes the other tracker's JSON. Every WeKan permission therefore applies
unchanged - read-only and comment-only roles, assigned-only members, list
permissions - and an API that is not ticked answers 404. All of them sit
under /api, so WITH_API turns them off with the rest of the REST API.

Trello: members, boards, lists, cards, labels, comments and checklists; a
deleted card is archived. Jira: projects are boards (the board key), issues
are cards (DEV-7), statuses are lists and transitions move cards, with
simple JQL. GitHub and Gitea: repositories are boards and issues are cards,
open or closed as in Board View / Version Control, with labels, milestones,
comments and Link pagination.

The new strings are translated in every locale. A runtime test over real
HTTP shows a read-only member refused and a Trello-created card readable
through Jira and GitHub.

Thanks to xet7 !

Fixes #4930.
2026-10-14 13:11:23 +03:00
Lauri Ojansivu ebf2a019a6 "Lists missing their swimlane" no longer counts board-wide lists, and Restore never hides cards.
The check counted every board-wide list whose position history recorded
the swimlane it was created in, so lists made since the automatic
un-binding stopped (#6515, released in v10.31) were counted too, and the
count kept growing. Restore would have bound them back to that swimlane,
hiding the cards they hold in other swimlanes - 490 cards in 14 lists on
the reporter's instance.

Now a list created after v10.31's release is never offered, being
board-wide by design, and a list with any card (archived ones too) in a
swimlane other than the one it would be bound to is never restored. A list
that really lost its binding, with cards only in its own swimlane, is still
restored. tests/listSwimlaneRestore.test.cjs and a runtime test on a real
database cover both rules and that case.

Thanks to Raymond-Voogt and xet7 !

Fixes #6766.
2026-10-14 11:03:53 +03:00
Lauri Ojansivu 0a3797dbf6 Archiving a list archives its cards, and restoring it brings them back.
Only template lists archived their cards, so a normal list's cards stayed
visible in the Lists, Table and Calendar views. A server hook on the list's
archived field now archives the cards of every list, whichever way it is
archived, and restore brings back exactly those - the rule #2292 gave
swimlanes. Cards archived with the list get the list's archivedAt, so a
browser clock that differs from the server's cannot keep them archived.

Thanks to Raymond-Voogt and xet7 !

Fixes #6765.
2026-10-14 09:28:45 +03:00
Lauri Ojansivu 7595727917 Boards every signed-in user may edit, per-list permissions, board keys and shared labels.
A board can let every signed-in user edit it, when Admin Panel / Settings /
Visibility allows it: a non-member then comments, edits and moves cards like
a Normal member, and their first edit makes them one. Board-wide settings
stay members-only.

Lists can allow or refuse editing and commenting per role (list menu, board
admins): built-in roles, custom roles and, on an open board, everyone signed
in. The server applies it to card, checklist, attachment and comment writes
and to moves into the list; the REST API honours a list's refusal on every
per-list card route. A direct client write of the setting is refused and
shown in Admin Panel / Problems.

Every board has a key, unique in the instance, suggested from its title and
set for existing boards at startup; card numbers show as KEY-7 and searching
for KEY-7 finds the card.

Shared labels in Admin Panel / Labels, for every board or an organization's
or team's boards; a board uses them beside its own, and a rename or colour
change reaches every board that uses it.

New strings translated in all languages. Low confidence: chr, tlh, wal, ay,
ace, nah, gn, iu, zgh, rup, wo, se, ff, tig, vo, bm, kl, bua, nap, mai, to,
ks, qu, bo, fj, haw, om, ss, ts, ve-PP, lld, scn.

Thanks to Meeques, justinr1234, tiFabGrinch, ejlkemper and xet7 !

Fixes #4575,
Fixes #4527,
Fixes #2449,
Fixes #2450,
Fixes #2761,
Fixes #4698.
2026-10-14 09:28:45 +03:00
Lauri Ojansivu 50bb989eb8 Custom board roles, and team memberships that leave with the team.
#3022 (decided 2026-10-14): a site admin builds named roles in Admin
Panel / People / Roles from the capability matrix - sees all cards,
comments, edits, moves cards, invites - and a board admin gives one to a
member in the same popup as the built-in roles. Board admin stays
built-in. Every permission check asks boardRoleCapabilities, which
answers a custom role from the role; the member's built-in flags carry
the strongest built-in role that grants nothing more (fallbackRoleFor,
checked for every combination), so code reading a flag never grants
more, and a deleted role leaves exactly that. Where a role is asked by
name (hasWorker, isCommentOnly, ...) a custom role reads as the built-in
role that does what it does; commenting is asked as a capability
everywhere. Invites, REST whole-board reads, imports (a foreign custom
role is dropped) and member mapping (all eight flags now, not four)
follow it. The six new strings are translated in all 234 locales.

#4178 (decided 2026-10-14): a team or organization that gives board
memberships takes them away again when the user leaves it - only those:
each records where it came from (grantedBy), a direct membership is
never touched, a board admin is kept, and a board admin's own add or
removal is final. Teams through user edits, LDAP, OIDC and the board
sidebar; organizations where they propagate members.

Also: the Roles Status table gets a Move cards column; the comment form,
reactions and chat ask the comment capability (a No comments member was
offered reactions the server refused).

Tests: customBoardRoles and groupBoardMembership node suites, and the
runtime suites (9 passing) against a real database.

Thanks to xet7 and mfnalex !

Fixes #3022,
Fixes #4178.
2026-10-14 08:20:49 +03:00
Lauri Ojansivu 2352f1f44f Fix GitHub CodeQL alerts #570-#580.
#570, #571 (incomplete multi-character sanitization): email to card
turned an HTML-only email into text with one pass of each removal, so a
script element spliced together by removing an inner one survived and its
contents reached the card ("<scr<script></script>ipt>alert(1)</script>").
Both removals now run to a fixed point.

#574 (regular expression injection): the single file's wekan.env writer
spliced the setting name into a RegExp. A setting must be an environment
variable name, is compared literally, and its value must be one line. The
kept-versions reader built a half-escaped RegExp from the file extension;
it now reads wekan-<version><exe> literally.

#572, #573 (incomplete string escaping): two runtime tests escaped only
some metacharacters; they compare literally now. #575-#580 (URL substring
and hostname patterns): translation tests matched example hostnames with
unescaped dots or substring checks; the dots are escaped and the hosts
bounded.

tests/tagStrippingFixedPoint.test.cjs missed the <[^>]+> spelling; it now
catches both, accepts a fixed-point helper only when it really loops, and
records the search-index text of server/lib/documentGif.js as never
rendered. tests/emailToCard.test.cjs fails on the old htmlToText;
tests/singleFile.test.cjs refuses regex and newline input in setting
names and values, and reads only real version files.

Nothing here is an attempt a user can make at runtime that the server
refuses, so there is no Admin Panel / Problems key to add.

Thanks to GitHub CodeQL and xet7 !
2026-10-14 07:35:20 +03:00
Lauri Ojansivu 57e05c4304 Email bounces from Mailgun, SendGrid, Postmark, Brevo, Mailjet, SparkPost, Mandrill and Resend.
Besides Amazon SES, WeKan now takes the bounce and spam-complaint
webhooks of the other common sending services, at
/api/inbound-email/bounces/<service>, each proven the way that service
signs: Mailgun's HMAC-SHA256, SendGrid's ECDSA signature over the raw body,
Mandrill's HMAC-SHA1 over the URL and fields, Resend's Svix signature; and
for Postmark, Brevo, Mailjet and SparkPost, which do not sign, a password
in the webhook address (Basic auth or ?secret=). Each service's events
become WeKan's hard, soft, automatic-reply and complaint categories, so the
same Admin Panel rules act on them. Bounces -> Other sending services
turns each on with its key or password, written only when typed and never
shown back; a forged or unsigned request is refused and logged in Problems
-> Security. These endpoints, like the SES one, work without WITH_API.

Mail systems with no webhook keep working as before: their bounce emails
reach WeKan by IMAP and are recognised as delivery status notifications.

Thanks to xet7 !
2026-10-13 18:54:06 +03:00
Lauri Ojansivu 79ac301675 Email bounces with Amazon SES, Problems -> Email, and runtime tests for sending and receiving.
Email that comes back is handled in WeKan instead of landing in the
administrator's own inbox. Admin Panel -> E-mail -> Bounces: hard bounces
(a mistyped invited address), soft bounces, automatic replies and spam
complaints, each with actions done after a count - list it, stop emailing
the address, tell who invited it, delete the invitation, ignore - as
listmonk and Discourse do it, and the list of addresses that bounced, which
an admin clears to email them again. Amazon SES Bounce and Complaint
notifications and mail SES receives arrive through SNS at
/api/inbound-email/ses, signature-checked against Amazon's certificate and
accepted only from the topics the Admin Panel lists. Delivery status
notifications and out-of-office replies arriving by IMAP, a provider
webhook or a Sandstorm grain are bounces too, never cards.

Admin Panel -> Problems -> Email shows what went wrong sending or
receiving: a send the mail server refused or could not reach, an IMAP
mailbox that cannot be read (never with its password), an unreadable
email, an email for a board that no longer takes email. Attempts stay in
Problems -> Security. The inbound email endpoints no longer need the whole
REST API turned on.

Runtime tests run WeKan's own transports against local SMTP and IMAP
servers over TCP, a real Sandstorm Maildir, the webhook over HTTP and
signed SNS messages; UI tests drive the Email and Chat views, the
email-to-card settings and the Bounces page. They found and this fixes:
every whole-message parse failed in the server bundle (nodemailer's
addressparser resolved to its ESM build), the Chat view's drag and drop
never started (dragscroll took the mouse) and dropped a card into the
target's previous list, and the Chat panes did not follow a change to a
right-to-left language.

Thanks to xet7 !

Fixes #794,
Fixes #3948.
2026-10-13 18:27:25 +03:00
Lauri Ojansivu 242c4b097c Sandstorm uses the same Node.js, npm and FerretDB as other platforms.
The .spk now carries the exact Node.js the Dockerfile pins (26.11.1), which
is what https://wekan.fi/version.txt advertises, downloaded and verified
with releases/embed-verified-node.sh like the zip bundles, instead of
Meteor's dev-bundle node or the newest Node 24. FerretDB is fetched by the
release tag version.txt names, and the Sandstorm and Windows workflows
install the Dockerfile's npm with releases/use-release-npm.sh instead of a
hard-coded npm 12.0.2. Comments and docs describing the current runtime
say Node 26.

Thanks to xet7 !
2026-10-11 13:12:21 +03:00
Lauri Ojansivu ab785acd1e Choose what notifications contain, and group and schedule them, for e-mail, the tray and webhooks.
One delivery model (models/lib/notificationDelivery.js) for every channel -
e-mail, the notification tray and outgoing webhooks - set in the
Notifications popup at Admin Panel, board and Member Settings scope, and in
each one-way webhook's form:

- Content. Webhooks: the text on or off, and which property groups are sent
  (standard, ids, names, links, actor, people, details), with checklist,
  list, swimlane and board names, before/after values, the card description
  and links added as opt-in groups. E-mail and tray: the classic sentence or
  a clear layout - the board as a link first, the actor and card in bold -
  and which parts are shown.
- Grouping: one message per event, per card, per board, or all together.
- Scheduling: immediately, every 5 minutes to 24 hours, or once a day, with
  optional quiet hours, in the time zone of whoever set it.

The most specific explicit setting wins: member, then board, then Admin
Panel for e-mail and tray; the webhook, then its board, then Admin Panel for
webhooks. A member can only leave their own name out of outgoing webhooks.
The built-in defaults keep today's behaviour. Grouped and scheduled webhooks
and e-mail go through durable queues that survive restarts; queued webhooks
use the SSRF guard and log a blocked address in Admin Panel - Problems.
Values of admin-only custom fields now reach only board admins in e-mail and
tray, and never a webhook.

The new strings are in English in every locale, pending Transifex.

Thanks to HaKePlan, Meeques and xet7 !

Fixes #3695,
Fixes #5171.
2026-10-10 15:28:26 +03:00
Lauri Ojansivu 746c097c9a Link the custom fields of two cards, so a change on one is carried to the other.
From a card's Custom Fields menu, "Link fields to another card" links it to
another card by a pasted card link or a title search, both ways or one way
(this card sends to a main card). Fields match by name and type; a dropdown
value is carried by its item name, a multi-select only when the other field
has every item, and fields on one card only (such as Remarks) stay there.
Linking fills only the other card's empty matching fields once.

A link is held on both cards and counts only when both sides match. Linking
needs read and edit rights on both cards; a card the user cannot read is "not
found". A carried value is written as the link's creator, recorded in
Activities and History, and only while that user may still read and edit both
cards; admin-only fields never take part. A loop guard stops echoes and rings,
with a depth limit and a write budget per change. A copied, imported or
restored card starts unlinked, a deleted card's links are removed from the
others, and a direct client write of the links is refused and trips a canary.

The new strings are in English in every locale, pending Transifex.

Thanks to MarcusDger and xet7 !

Fixes #5681.
2026-10-10 15:26:46 +03:00
Lauri Ojansivu a713154d70 Tick subtasks done from the parent card's Subtasks list, with done/total in its heading.
Each subtask row has a checkbox that marks the subtask card complete
(dueComplete, the card's own "Mark as complete"), and the Subtasks heading
shows "Subtasks (1/3)". A subtask is done when it is marked complete or
archived, which the minicard's subtask badge and "Hide completed subtasks"
now also count.

The setSubtaskDone method checks the edit right on the subtask itself, which
may be on another board; comment-only, read-only, worker and non-members are
refused, an assigned-only member may tick only a subtask assigned to them,
and an archived subtask is refused. The change is recorded in the subtask's
History like the card details toggle.

The new strings are in English in every locale, pending Transifex.

Thanks to zhoujunhaohao and xet7 !

Fixes #4693.
2026-10-10 15:25:16 +03:00
Lauri Ojansivu 32fa89fdc3 Attach a card to a card, as Trello's card attachments, and import them from Trello.
A card can now have other cards attached to it, beside its files. In the
card's Attachments, + offers "Attach card": type part of a card title on
this board and pick it, or paste a card link (Copy card link gives one) to a
card on any board you can read. An attached card shows its title, board and
list, opens that card, and can be removed again.

- Data: cards.attachedCardIds, the attached cards' ids, at most 100
  (models/lib/attachedCards.js).
- Methods (server/models/attachedCards.js): attachCardToCard and
  detachCardFromCard need the right to edit the card, and only a card the
  user can read can be attached - its board's read rule and, for an
  assigned-only member, a card assigned to them. Any other is refused as
  "not found", the same as a card that does not exist. attachedCardsInfo
  shows an attached card's title only to a viewer who can read it; anybody
  else sees that one is there.
- Trello import: an attachment that links to a Trello card of the same
  export becomes an attached card; a link to a card of another board stays
  in the description under Links, as attached links always did.
- WeKan import: attached cards follow the cards that came in the same
  export to their new ids; the rest are dropped.

Tests: tests/attachedCards.test.cjs (the module, the permission rules and
the wiring), server/lib/tests/attachedCards.tests.js (attaching across
boards, refusing unreadable and assigned-only cards, a non-editor, and
hiding what a viewer cannot read) and tests/playwright/specs/attached-cards.e2e.js
(attach by title, refuse a hidden card, open, remove; and a Trello import).
Docs: docs/Features/Cards/Attachments/Attached-Cards.md.

Thanks to ricardoboss and xet7 !

Fixes #3257.
2026-10-10 14:24:44 +03:00
Lauri Ojansivu d1de4a1fe6 Stored Sync rules bring a card's labels to another board as Card.copy and Card.move do.
Since #1759 a card copied or moved to another board brings its labels: a
label that board lacks is created there when the actor is its admin. The
stored (durable) rule copyCard, move to another board and move-all onto
another board still matched by name only and dropped the rest, so the
durable copy or move was no longer the ordinary one - the parity three
server tests check - and the card lost a label a direct copy would keep.

The durable plans now use the same planCrossBoardLabels with the rule's
actor. The labels to create are saved in the command (copy) or move
(single move, and each move-all unit), so a replay creates nothing twice:
each is pushed only when no label with its id is on that board yet, before
the card that names it is written. In a move-all, a label created for one
card is that board's label for the next, as when Card.move moves them one
by one. Commands saved before this, without the labels, still validate.

The server tests now expect the created label, once across a replay, and
the ordinary copy or move finding it; the card-move test gains the negative
of a mover who is not the new board's admin, where the label is dropped and
its activity removed. The command tests cover the new field, its validation
and an older command without it.

Thanks to xet7 !
2026-10-10 11:44:19 +03:00
Lauri Ojansivu ef54907836 Import Scrum planning into an existing board.
Every Scrum import used to create a new board. A board administrator can
now import a native wekan-scrum-2 transfer, or a WeKan board export, into
a board that already exists, from the Sprints view: Preview shows what
would change and writes nothing, Import writes it.

Sprints and releases are matched by ID on this board, then by
provenance, then by a name exactly one record has on each side; the rest
are created once with the source's provenance, so importing the same
file again changes nothing. Cards are matched by ID, or by card number
and title, and never created; unmatched, ambiguous and other boards'
cards are reported and left alone. Matched cards get the file's sprint,
releases, backlog rank, issue type and acceptance criteria; a move into a
finished sprint is refused. The writes go through the journaled Scrum
import stage, so an interrupted import is finished or discarded the same
way, and are recorded as one Scrum History change.

Thanks to xet7 !
2026-10-08 12:36:57 +03:00
Lauri Ojansivu c06bf8d0e9 Sync sprints and releases into Scrum planning.
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 !
2026-10-08 12:35:58 +03:00
Lauri Ojansivu 958e9e13f3 Import Scrum sprints and releases from GitLab, OpenProject and Asana.
Only the Jira importer created sprints and releases. GitLab iterations and
milestones became nothing but milestone: and iteration: labels, OpenProject
versions only a version: label, and Asana milestones and Trello produced
nothing Scrum-related, so a board moved from those tools lost its planning.

Imports now map what each export really carries, through the same journaled
Scrum import stage as Jira and WeKan JSON, so an interrupted import is
recovered the same way. GitLab iterations become sprints and milestones
releases, with their dates and state. OpenProject versions become releases
and its Sprint resources sprints; position sets the backlog rank and story
points become the board's estimate field. Asana milestone tasks become
releases for themselves and the tasks they wait for. Trello has no sprints or
releases; its Power-Up data is counted in the import loss report.

As for Jira, a started sprint is imported as planned and a finished one not
at all, because the exports have no commitment or close snapshot; both are
reported. Malformed dates, unknown states, duplicate names and cards in an
iteration that is not imported are reported, never invented. The milestone
and iteration labels stay for List Sync and existing boards. The import
page's Scrum settings part now also decides whether external imports bring
their planning in. GitLab and OpenProject exports write each card's sprint
and first release back so a board round-trips.

Thanks to xet7 !
2026-10-08 12:08:29 +03:00
Lauri Ojansivu 9ad9813c09 Let a board admin resolve a Scrum undo or redo that stopped on a conflict.
A Scrum History undo, redo or restore keeps a checkpoint that blocks every
Scrum edit on its board until it finishes, and only its author could retry
it, with the same plan. When somebody else had changed one of its records,
its History row changed or its author lost write access, every retry failed
the same way, the checkpoint could not be discarded online or offline, and
the board's Scrum edits stayed blocked for good.

A retry that fails for a reason the next one would meet again now marks its
checkpoint. A board administrator sees such a checkpoint in the History
recovery notice and can roll it back, which restores every record it wrote
to the saved "before" value and revision and is offered only when nobody
changed those records since and none of its History was written, or keep the
board as it is, which removes the checkpoint and writes nothing while
reporting how much of the operation had been written. A checkpoint that has
not stopped on a conflict stays its author's to retry. The resolution names
the checkpoint it resolves, so a repeat is a no-op; it claims the checkpoint
by compare-and-set, fencing the author's workers, waits for an in-flight
write, and checks every record before and after its own writes. Each one is
recorded in Admin Panel / Problems / Recovery. The offline command
releases/recover-scrum-history.cjs does the same with every writer stopped.

Unit, integration (against MongoDB 7), Meteor and Playwright tests cover
rollback, discard, refusals, concurrency and the offline command. New text
is in English, pending Transifex.

Thanks to xet7 !
2026-10-08 12:06:49 +03:00
Lauri Ojansivu cb69750b17 Let administrators discard List Sync operations that cannot be replayed.
A saved List Sync operation whose list was removed, recreated or
reconfigured, or whose actor lost full-list write access, could never be
replayed. The replay job refused it every minute with only a console line,
and because a new Sync of the list resumes the pending operation first,
that list could not Sync at all.

Such an operation is now marked once, with one Recovery event, and a
blocked manual Sync says why. Admin Panel / Problems / Recovery lists these
operations with what they applied and their live replayability. An
instance administrator can discard one only while the same checks a replay
makes still fail. The discard holds the list's Sync lease, records one
immutable decision, then removes the saved steps and the operation marker,
reading each removal back. It writes no card: changes already applied stay
and the rest are never written. A retry or a second administrator only
finishes the removal, and a replay that finds a decided discard completes it
instead of resuming. The intent stays as evidence and the discard is
audited in Recovery.

Unit, source-wiring and negative tests cover recording once, refusing
non-administrators and replayable operations, and discarding twice; an app
test and a Playwright case cover the Recovery page. New interface text is
in English, pending Transifex.

Thanks to xet7 !
2026-10-08 11:53:06 +03:00
Lauri Ojansivu 727ceedd01 Let a card be in more than one release.
A card had exactly one release, scrum.releaseId. Jira import kept only the
first fix version of an issue and reported the rest as lost, Jira export
wrote no fix versions at all, and the card UI could not show or pick more
than one release.

A card's releases are now a list, scrum.releaseIds, with releaseId kept as
its first entry so older servers, importers and REST readers still see one.
Existing cards are not migrated: every reader goes through cardReleaseIds(),
which reads the list and the old single field the same way, so cards saved
either way work side by side, and a card moves to the new form on its next
Scrum save. A save with releaseIds replaces the list; a save with only
releaseId, from an older client, replaces the first release and keeps the
others, and null clears them. Every release must belong to the board,
checked in one query; duplicates collapse and a releaseId that contradicts
the list is refused.

Copies and moves to another board link each release by name. The native
transfer writes one release exactly as before and adds releaseIds only for
cards with several, and remaps each of them on import. Jira import maps every
fix version and Jira export writes them all as fixVersions. Board View /
Sprints shows each release's cards and how many are done, counting a card in
each of its releases. Scrum History checks and guards every release, and
rule e-mails name them all. The Product Backlog and card details use a
multiple select.

tests/scrumMultipleReleases.test.cjs covers the rules and fails if any code
reads the single field directly; a Playwright spec drives the UI. New text is
in English, pending Transifex.

Thanks to xet7 !
2026-10-08 11:51:44 +03:00
Lauri Ojansivu 576a8438aa Activity notification intent test: name each intent by its activity, not by arrival order.
The mocha test "stores intent before dispatch, preserves pending failures
and suppresses deferred or disabled capture" failed about one run in four
with "notification hook did not settle". Traced with in-memory lease,
recovery and gate events: the two activities' insert hooks dispatch
concurrently, and when the second activity reached the subscriber first,
intentIds[0] held ITS intent - the one the test makes fail on purpose. The
test then waited for that intent to complete, which never happens, while
the one-second recovery scan kept retrying it. The application behaved as
designed; the test assumed an order the hooks never promised.

Intents are now recorded against their activity. The checks that counted
subscriber calls also allowed for the recovery scan, which legitimately
retries a pending intent on its own: the recipient is denied before the
replacement subscriber is installed, calls are compared with a snapshot,
the final retry waits out a scan that holds the lease at that instant, and
exactly one delivery is required whichever of the two made it.

The test passed 12 of 12 runs in isolation afterwards; it failed 1 of 4
before.

Thanks to xet7 !
2026-10-07 16:15:44 +03:00
Lauri Ojansivu b7084fdc06 A rule's email follows the card to the board the rule's own move took it to.
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 !
2026-10-03 14:26:15 +03:00
Lauri Ojansivu 509f1d97fc Refuse a rule naming another board's trigger, and match rules on their own board (RepointBleed sibling).
Reviewing the legacy direct Rules writes: a board admin of their own board
could save a rule that named a trigger of a board they do not administer.
Only that board's own rules run on its activities, but the matcher took a
trigger's rule from Trigger.getRule() - whichever rule named it first - so
the other board's own rule could silently stop running. The matcher now
looks up the trigger's rule on the activity's board, and a DDP insert or
update of a rule naming another board's trigger is refused and recorded in
Admin Panel / Problems under RepointBleed (no client names one: the rule
editor creates the trigger on the rule's board first).

Tests: tests/repointBleed.test.cjs (the decision for insert, $set,
$addToSet and $push, the negatives, and the matcher's source), and a server
test that, without the change, accepted the foreign rule and lost the
victim board's rule.

Thanks to xet7 !
2026-10-03 10:26:48 +03:00
Lauri Ojansivu 6d3b27aeb6 Refuse a card insert naming another board's list or swimlane (BoardBleed sibling).
A client could insert a card on a board it may write to while naming the
list and swimlane of another, private board. The card stayed on its own
board, but its creation activity carried that list's and swimlane's titles
and the board's rules saw them, so a member could read the names of
another board's lists by id. The server's own copies already check their
destination (server/lib/cardCopyDestination.js); DDP inserts now do too,
and refuse such a card. No client sends one, so the attempt is recorded in
Admin Panel / Problems under BoardBleed (canary card.foreign-placement).

Found while reviewing the client-side template copy writes, which go
through the same Cards insert rules: a template or linked card is always
created on the board that owns its list.

Tests: a server test that refuses another board's list and swimlane with
no card or activity written and allows the board's own, failing without
the rule; the canary catalogue and coverage suites; and the template,
linked-card, card-copy and card browser specs in Chromium.

Thanks to xet7 !
2026-10-03 10:20:29 +03:00
Lauri Ojansivu 5fad29a254 Copy only the subtasks the copier may copy (AssignedBleed copy sibling).
A copy of a card took every subtask of it. An assigned-only member who
copied a card assigned to them got copies of its subtasks assigned to
others, and any member got copies of its subtasks on boards they cannot
read - a parent may have subtasks on another board (#3626). Card.copy and
the durable rule copy now carry only the subtasks the copier could read and
copy themselves (models/lib/boardCardScope.js copyableSubtasks); a copy
with no acting user, made inside the server, keeps them all as before.

Not recorded in Admin Panel / Problems: copying a card with subtasks is
ordinary use, and the copy simply leaves out what the copier may not have.

Tests: tests/copySubtaskScope.test.cjs (the decision, and a scan that every
place copying subtasks filters them) and a server test through copyCard,
which without the fix gave an assigned-only member copies of another
member's subtask and of one on a private board.

Thanks to xet7 !
2026-10-03 10:05:47 +03:00
Lauri Ojansivu 64489c5a2a Let a rule's move-all onto another board follow a move to another board, durably.
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 !
2026-10-03 09:59:43 +03:00
Lauri Ojansivu b07a8a421b Let a rule move its card on to a third board after a move to another, durably.
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 !
2026-10-03 09:56:00 +03:00
Lauri Ojansivu 0218cd823f Run each large-sprint rollover and undo job on one server at a time, by lease.
The background rollover and the background undo or redo of a large batch
were resumed by every server that found them after a restart; two of them
on one job wrote alike, and the card writes' compare-and-set stopped one
with a conflict the Scrum view showed as a failure. Each step now first
takes or renews a lease on the sprint or the job, one minute long, that a
server which went away loses when it runs out. A live lease of another
server leaves the job to it: a retried close says the rollover is running
there, and undo and redo on the board wait. The lease is not History
content and is not sent to the browser.

Tests: a foreign live lease leaves both the rollover and the undo job
untouched, and an expired one is taken over.

Thanks to xet7 !
2026-10-03 09:49:31 +03:00
Lauri Ojansivu 30f57cf837 Give the applyListWidth test a writing member, and a read-only negative.
Since 2026-10-02 a list's width is a shared board setting that needs write
access, read from the board's members; the test's stub board had none, so
the positive case failed. It now has a writing member, and a read-only
member is refused without a write.

Thanks to xet7 !
2026-10-03 09:44:45 +03:00
Lauri Ojansivu acb2c0786a Resolve a rule's later move, sort, move-all and archive on the board its card went to.
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 !
2026-10-03 09:44:45 +03:00
Lauri Ojansivu 600fc3b4de Close and undo very large sprints in the background, with progress in the Scrum view.
As decided on 2026-10-03, every per-card guard stays, and the browser
never waits on one call for the whole of a large sprint:

- A close of more than one chunk (2,000 cards) returns once the sprint is
  closed and its plan stored; its rollover continues in the background,
  chunk by chunk under the board's lock, recorded under the close's named
  History batch. Its progress is on the sprint, a failure is kept there for
  the Scrum view's resume button, and a restart resumes it. A smaller
  sprint is still closed and rolled over in one History row in the call.
- An undo or redo whose batch has more than four rows left applies the
  first row in the call and the rest as a background job (scrumBatchJobs),
  as the user who asked and with the same derived request IDs, so a retry
  or a restart resumes it. Undo and redo on that board wait for it.
- The Scrum view shows both as progress bars and polls quietly while one
  runs.

The board-copy, native-import and Scrum menu specs read snapshot rows
through a helper now that they live outside the sprint, and the sprint
report's chart is no longer counted together with the daily and
change-by-change charts below it, which loaded in WebKit first.

Thanks to xet7 !
2026-10-03 09:31:44 +03:00