Repository navigation
fix(meetings): select a person's older tasks at once and add them in one step - #322
Conversation
…one step The earlier-task chooser in meeting preparation added the selected tasks one request at a time. Every request refreshed the agenda behind the dialog, so adding ten tasks took long and the page jumped once per task. - Each person group (and "No assignee") has a three-state checkbox that selects or clears the group's tasks visible under the current search. - POST /api/meetings/[id]/tasks accepts `taskIds` (up to 500, deduplicated) next to the single `taskId`. All ids are checked and added in one transaction under the agenda lock: one refused id refuses the batch and the error names the refused ids. Tasks already active in the agenda are skipped, a removed task is restored, and positions follow the selection order after the current last task. - The dialog sends one request with one optimistic update and closes; on failure it keeps the selection and shows one error. - The listing and the add share one eligibility condition, matching the item rule of getVisibleTask; personal tasks no longer appear in the chooser (they could never be added).
|
Review: fix(meetings): select a person's older tasks at once and add them in one step Batches the older-task picker into one Verdict: COMMENT Findings: Blocker 0 | Critical 0 | Major 1 | Minor 0 | Nit 0 Findings MAJOR — Missing tests The interaction above: older-task addition followed by a Everything else checked out: user scoping and the agenda lock are correct, the route's union schema ( |
The last-meeting snapshot re-inserts its tasks at positions 0..N-1 when the task source changes or the agenda is filed elsewhere. Added older tasks had moved to max+1, so they could tie or interleave with a larger re-snapshot. They start at OLDER_TASK_POSITION_BASE (100000) again, sequential in selection order, in the service and the optimistic update; agenda tasks order by position, then task id.
|
Review: fix(meetings): select a person's older tasks at once and add them in one step Batches the older-task picker into one Verdict: APPROVE Findings: Blocker 0 | Critical 0 | Major 0 | Minor 0 | Nit 0 Prior finding, now resolved The only MAJOR finding from the first review round ( Everything else checked
Missing tests None found; the integration suite covers ordering, all-or-nothing, restore, dedup, active-skip, folder/visibility edge cases, concurrency (serialized and overlapping batches), and malformed input. Component tests cover group tri-state behavior, batched add/optimistic update, and failure/retry. |
Summary
The earlier-task chooser in meeting preparation ("Add older tasks…") added the selected tasks one request at a time. Every request refreshed the agenda behind the dialog, so adding ten tasks took long and the page jumped once per task. Selecting all tasks of one person also took one click per task.
Changes
POST /api/meetings/[id]/tasksacceptstaskIds(up to 500, deduplicated) next to the singletaskId, so MCP and other callers keep working. All ids are checked and added in one transaction under the agenda lock:getVisibleTask's item rule. Personal tasks no longer appear in the chooser; they could never be added.<h3>, so the heading reads only the person's name.Testing
older-tasks-dialog.test.tsx: group select-all only on visible tasks, mixed state, one request and one optimistic update, failure keeps the selection.older-tasks-batch.integration.test.ts(Postgres): ordering, all-or-nothing on an invisible task, restore, duplicates, already-active skips, concurrent overlapping batches.POSTwith both ids. The dialog closed and both tasks appeared in the agenda.