Problem
In src/bot/callbacks/newtask-flow.ts, the board selection callback (handleNewTaskBoardCallback) re-fetches the full board list from the API and uses the button's index to resolve which board was selected:
const boards = await client.getBoards(flow.workspacePublicId);
const board = boards[boardIdx];
If a board is added, removed, or reordered between when the picker was rendered and when the user clicks a button, the index may point to the wrong board.
Proposed Fix
Store the board mapping (publicId + name) in the flow object when the picker is first rendered, similar to how lists are already stored:
flow.boards = boards.map(b => ({ publicId: b.publicId, name: b.name }));
Then resolve from flow.boards[boardIdx] in the callback instead of re-fetching.
Context
Flagged during cage-match review of PR #13 by KelvinBitBrawler.
Problem
In
src/bot/callbacks/newtask-flow.ts, the board selection callback (handleNewTaskBoardCallback) re-fetches the full board list from the API and uses the button's index to resolve which board was selected:If a board is added, removed, or reordered between when the picker was rendered and when the user clicks a button, the index may point to the wrong board.
Proposed Fix
Store the board mapping (publicId + name) in the flow object when the picker is first rendered, similar to how
listsare already stored:Then resolve from
flow.boards[boardIdx]in the callback instead of re-fetching.Context
Flagged during cage-match review of PR #13 by KelvinBitBrawler.