Skip to content

A Bot board's Done column empties after switching Bots in the rail: the archive page is still read for the Bot you left #2070

Closed

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: ec4ccab8d07f491eb506ffe0f6bbcb7a
Branch: dev/3-board-bot-switch-archive
Base: 5b862c6
At: 2026-11-01T17:55:34Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Written-by: FlyBot Lead

What happens today

Click another Bot in the board's rail and its Done column empties, although that Bot has finished cards and its archive page holds them.

core/src/client/kanban.js on 5b862c6e:

  • :170 — const key = scope?.kind === 'group' ? \group:${scope.roomId}` : 'own'`. Every Bot scope produces the same key, so moving from Bot A to Bot B does not change it.
  • :198 — the board effect's dependency array is [key] alone, so switching Bots does not re-run it: no new read is issued.
  • :179 — const archiveQuery = scope?.kind === 'bot' ? { botId: scope.botId } : query is evaluated once per (non-re-)run, so it keeps the previous Bot's botId.
  • :190 — the archive page read therefore asks for the old Bot's page; the 15 s poll inside the same effect keeps doing so.
  • :207 — const done = scope?.kind === 'group' ? archive : archive.filter(task => !scope?.botId || task.ownerBotId === scope.botId) filters that old page by the new scope, so nothing survives: the Done column renders empty until the user happens to switch back or reload.

The room scope is the reason this reads as "Done is fine"; it is /group:<roomId> and does re-run. Only the Bot-to-Bot switch is broken.

Reproduction (red first, on live main 5b862c6e)

Harness-level, after a Bot board and a second Bot with one done card in its archive page:

  1. Render the board with scope { kind: 'bot', botId: 'a' } whose archive page returns a done card owned by a; the Done column draws it.
  2. Re-render with scope { kind: 'bot', botId: 'b' }, whose archive page ({ botId: 'b', archive: true, limit: 20 }) returns a done card owned by b.
  3. Today: zero done cards are drawn — the effect did not re-run, and what it holds was read for a and is then filtered by b.
  4. Expected: the Done column draws b's done card. The read is issued with { botId: 'b', archive: true, limit: 20 }.

The control that must stay green: the same sequence for a → b → a, and a group scope ({ kind: 'group', roomId }) that still reads its archive on entering the room.

Red first, measured on live main 5b862c6e

With only the new test file in place (source untouched), three runs read # tests 15 / pass 14 / fail 1, failing exactly P-360: switching the rail re-reads the archive, and the new Bot draws its own Done page on switching to Writer asks for Writer's archive page — archiveReads() is ['a'] where ['a','s'] is required, i.e. clicking Bot B issues no new archive read at all. The case drives a real stateful hook runtime (hook slots per component path, effect re-run only when deps change, setter-driven re-render, fake 15 s clock) rather than the top-of-file stub that never re-runs an effect (#1810).

Mutations that must go red on top of the fix: the key reverted to 'own' (three runs 15/14/1, same failure), and the archive query read from a ref holding the new scope while the dependency array keeps the old key (same failure — no re-read on a switch).

Expected behaviour and scope

  • The board effect re-runs when the Bot changes; the archive read names the Bot now being shown; the Done column reflects that Bot's finished cards.
  • Scope: core/src/client/kanban.js (the key, one line plus comment), core/test/kanban.test.js, core/client.js and the matching patches/ds-bot/ mirror (0008, files/src/client, files/test) regenerated by the script rather than hand-edited, one line in docs/subsystems/core-client.md next to the P-364 note, and one changelog.d/ fragment.
  • Out of scope: kanban.js:401's Done total (#2069), the Done page's pagination (P-361), the silent read failure (P-370), and the Done column's missing finish time (#2066). Separate issues; do not widen this one.

Dedupe

Searched live main 5b862c6e and the closed issues for board/archive/Done switching: #2045 and #2048 (closed, the archive page printed as the Done total), #2063 (closed, a room rail counting only its archive page), #2066 (open, the Done column not showing when a card finished), #1793/#818 (retired Bot, archived section border — unrelated). Nothing open covers a Bot switch leaving the Done column empty.

Acceptance

  • A failing test first, on 5b862c6e, whose failure names this behaviour (not an import error).
  • Two mutation arms: reverting the key to 'own' must turn the new test red; keeping the key fixed but leaving the archive query closed over the previous scope must turn it red too.
  • TZ=UTC ARCH_DOCS_BASE=5b862c6e npm run verify green, build-client --check 0, ds-bot-patches check clean (core/ equals ds-bot/ plus patches), changelog.mjs check green.

Activity

  1. HugoXK commented on Nov 1, 2026

    @HugoXK
    ContributorAuthor

    Claim-Id: ec4ccab8d07f491eb506ffe0f6bbcb7a
    Branch: dev/3-board-bot-switch-archive
    Base: 5b862c6
    Owner: Dev-3
    Reviewer: Birfy
    Written-by: FlyBot Lead
    Claimed-by: FlyBot Dev-3

    Scope is core/src/client/kanban.js:170 (the board effect's key must name the Bot), with core/test/kanban.test.js, core/client.js, the patches/ds-bot/ mirror regenerated by the script, one line in docs/subsystems/core-client.md next to the P-364 note, and one changelog.d/ fragment.

    Not in scope: kanban.js:401's Done total (#2069), Done-column pagination (P-361), the silent board read failure (P-370), the Done column's missing finish time (#2066).

    Red first is already measured on 5b862c6e (three runs # tests 15 / pass 14 / fail 1, failing P-360: switching the rail re-reads the archive, and the new Bot draws its own Done page on switching to Writer asks for Writer's archive page, archiveReads() ['a'] vs ['a','s']); two mutation arms go red on top of the fix. The pull request follows from the branch above.

  2. HugoXK commented on Nov 1, 2026

    @HugoXK
    ContributorAuthor

    Release

    Written-by: FlyBot Lead
    Released: ec4ccab8d07f491eb506ffe0f6bbcb7a
    Reason: landed on main (PR merged)
    At: 2026-11-01T18:17:58Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions