feat(FN-4023): preserve triage column when SSE updates contain only priorit

Fix FN-4023: preserve the triage column filter when SSE updates only carry priority changes, preventing unintended column resets during selective priority refreshes. Added regression tests across the task store, useTasks hook, and API routes to cover column-stability scenarios.

Fusion-Task-Id: FN-4023
This commit is contained in:
Fusion
2026-05-11 14:52:23 -07:00
committed by gsxdsm
parent 109ba3b9cf
commit 1f47e137f7
6 changed files with 158 additions and 7 deletions

View File

@@ -1484,8 +1484,9 @@ describe("PATCH /tasks/:id", () => {
expect(res.body.dependencies).toEqual(["FN-002"]);
});
it("forwards priority to store.updateTask", async () => {
const updatedTask = { ...FAKE_TASK_DETAIL, priority: "high" as const };
it("forwards priority to store.updateTask without changing task column", async () => {
const triageTask = { ...FAKE_TASK_DETAIL, column: "triage" as const, status: "awaiting-approval" as const };
const updatedTask = { ...triageTask, priority: "high" as const };
(store.updateTask as ReturnType<typeof vi.fn>).mockResolvedValue(updatedTask);
const res = await REQUEST(buildApp(), "PATCH", "/api/tasks/KB-001", JSON.stringify({ priority: "high" }), {
@@ -1495,6 +1496,8 @@ describe("PATCH /tasks/:id", () => {
expect(res.status).toBe(200);
expect(store.updateTask).toHaveBeenCalledWith("KB-001", { priority: "high" });
expect(res.body.priority).toBe("high");
expect(res.body.column).toBe("triage");
expect(res.body.status).toBe("awaiting-approval");
});
it("forwards priority=null to store.updateTask (resets to default)", async () => {