Skip to content

fix(task-board): make a column role unique when reassigned - #6722

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/task-board-column-role-uniqueness
Aug 29, 2026
Merged

fix(task-board): make a column role unique when reassigned#6722
pedrofrxncx merged 1 commit into
mainfrom
fix/task-board-column-role-uniqueness

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Follows #6718.

TASK_BOARD_COLUMN_ROLE_SET (and the underlying BoardColumnStorage.setRole) writes a role onto the target column but never clears it from wherever it used to be. Re-pointing the org's "archived" (or "in_review") role from column A to column B leaves both A and B carrying the role — archiveColumn()/automationFor() pick a match with .find(), so which column actually fires the archive sweep or the review automation becomes arbitrary based on column position, and the previous column silently keeps acting as the archive/review lane even though the org believes it moved.

Failure scenario: an org sets archived on column BACKLOG, later reassigns it to Code Review (e.g. renaming their tracker's done-lane). Before this fix, BACKLOG still has role: "archived" in storage, so a card auto-archived could land back in BACKLOG depending on column ordering, not the org's intended column.

Fix: setRole() now clears the role from any other column in the org that holds it, in the same DB transaction, before writing it to the target column — a role names one column.

Regression test added in board-handler.integration.test.ts ("moves a role rather than duplicating it onto a second column"), following the file's existing real-Postgres integration-test pattern.

To confirm: DATABASE_URL=... bun test apps/api/src/tools/task-board/board-handler.integration.test.ts (needs the storage-integration Postgres service, per the file's own header — I could not run it locally since this laptop's embedded Postgres belongs to an unrelated project with a divergent migration history; CI's storage-integration job will exercise it).

Locally verified: bun run fmt, bunx tsc --noEmit (apps/api, clean on touched files), bunx oxlint on both changed files (0 warnings/errors). Full CI (including storage-integration) validates the rest.


Summary by cubic

Fixes setRole() so a column role moves instead of duplicating when reassigned. Re-pointing archived or in_review from one column to another used to leave the role on both columns, so archiveColumn() and automationFor() picked arbitrarily by column position and the old column silently kept acting as the archive or review lane. Now the role is cleared from any other column in the org in the same transaction before being written to the target.

Regression test

  • Verifies a role moves rather than duplicating onto a second column in board-handler.integration.test.ts.

Written for commit eb896ac. Summary will update on new commits.

Review in cubic

Follows #6718. setRole() wrote the new role onto the target column but
left it on whichever column held it before, so re-pointing "archived"
(or "in_review") to a second column left two columns quietly claiming
the same role. archiveColumn()/automationFor() pick the first match by
position, so which one actually fires becomes arbitrary and the old
column silently keeps acting archived/in_review.

Fix: setRole() now clears the role from any other column in the org
that holds it, in the same transaction, before writing it to the
target column.
@pedrofrxncx
pedrofrxncx merged commit b78fd86 into main Aug 29, 2026
34 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/task-board-column-role-uniqueness branch August 29, 2026 06:04
decocms Bot pushed a commit that referenced this pull request Aug 29, 2026
PR: #6722 fix(task-board): make a column role unique when reassigned
Bump type: patch

- decocms (apps/api/package.json): 4.303.2 -> 4.303.3
- @decocms/native (apps/native/package.json): 4.303.2 -> 4.303.3

Deploy-Scope: server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant