filterConversationsByQuery.tsfix(tasks): do not let the exit animation wipe a failed completion
Ordering regression from making the completion write immediate. The row is
removed from the store 500ms after the click so the completion animation can
finish. While the write sat at t+5s that removal always came first, so a failure
rolled back afterwards and the restore stuck.
An immediate write can fail well inside 500ms — an auth error, an offline fetch
rejecting straight away — and the still-pending removal then wipes the row the
error handler just put back. The user gets "Failed to complete task" AND loses
the task, which is a worse outcome than the bug this change set out to fix.
The animation timer now respects a `completionFailed` flag set last in the
write's error handler, so it cannot observe a half-done rollback. Covered by a
test that fails without it.
Also: absolute imports for `SidebarConversation` in the four sidebar files, per
the repo convention (Greptile's one outstanding finding on this PR).
Co-Authored-By: Claude Opus 5 (1M context) <<email>>Sep 4, 2026, 12:45 AM1 defectgroupSidebarConversations.tsfix(tasks): do not let the exit animation wipe a failed completion
Ordering regression from making the completion write immediate. The row is
removed from the store 500ms after the click so the completion animation can
finish. While the write sat at t+5s that removal always came first, so a failure
rolled back afterwards and the restore stuck.
An immediate write can fail well inside 500ms — an auth error, an offline fetch
rejecting straight away — and the still-pending removal then wipes the row the
error handler just put back. The user gets "Failed to complete task" AND loses
the task, which is a worse outcome than the bug this change set out to fix.
The animation timer now respects a `completionFailed` flag set last in the
write's error handler, so it cannot observe a half-done rollback. Covered by a
test that fails without it.
Also: absolute imports for `SidebarConversation` in the four sidebar files, per
the repo convention (Greptile's one outstanding finding on this PR).
Co-Authored-By: Claude Opus 5 (1M context) <<email>>Sep 4, 2026, 12:45 AM1 defect