fix(task-board): make a column role unique when reassigned - #6722
Merged
Conversation
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #6718.
TASK_BOARD_COLUMN_ROLE_SET(and the underlyingBoardColumnStorage.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
archivedon columnBACKLOG, later reassigns it toCode Review(e.g. renaming their tracker's done-lane). Before this fix,BACKLOGstill hasrole: "archived"in storage, so a card auto-archived could land back inBACKLOGdepending 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 thestorage-integrationPostgres 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'sstorage-integrationjob will exercise it).Locally verified:
bun run fmt,bunx tsc --noEmit(apps/api, clean on touched files),bunx oxlinton both changed files (0 warnings/errors). Full CI (includingstorage-integration) validates the rest.Summary by cubic
Fixes
setRole()so a column role moves instead of duplicating when reassigned. Re-pointingarchivedorin_reviewfrom one column to another used to leave the role on both columns, soarchiveColumn()andautomationFor()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
board-handler.integration.test.ts.Written for commit eb896ac. Summary will update on new commits.