Skip to content

Fix "Question not found" when closing decision tickets asked on another Mac - #242

Merged
danielehrhardt merged 1 commit into
mainfrom
fix/question-not-found
Oct 25, 2026
Merged

danielehrhardt merged 1 commit into
mainfrom
fix/question-not-found

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor

Problem

Closing a decision/approval ticket in My tasks failed with "Couldn't close the task – Question not found" (H-278, H-279 on the main Mac).

Those questions were asked in chats running on the stand-in Mac while the main Mac was offline. Tickets replicate through the shared data, but questions only travel as live question.created events, so the main Mac got the ticket without its question. closeHumanTask → answerQuestion then threw 404.

Fix

  • questionHere() (services/questions.ts): if the ticket's question is missing locally and its chat lives on another device, fetch it over the device link (GET /api/questions/:id) and adopt it through the mirror. The normal answer path then forwards the answer to the Mac where the run waits.
  • closeHumanTask: if the question still can't be found (device unreachable or question gone), the ticket closes like a plain decision and the chat continues with the answer instead of erroring.
  • catchUp / fetchConversation (remote/mirror.ts) also pull a chat's questions, so a question asked while nobody listened reaches the copy.

Tests

  • human-tasks: new tests for "question asked on another computer never got here" (fetched + forwarded) and "question gone" (closes, chat gets the answer).
  • human-tasks, questions, remote-mirror: 79 pass. devices-e2e: 15 pass. tsc --noEmit clean.

A question asked on another computer of the group while this one was offline
only arrived as its ticket (tickets replicate, questions travel as live events),
so closing the ticket failed with "Question not found".

- Closing such a ticket fetches the question from the computer that asked it and
  answers it there.
- When it can't be fetched, the ticket closes like a plain decision and its chat
  continues with the answer.
- Catching up on a chat also pulls its questions, so the copy is complete.
@danielehrhardt
danielehrhardt merged commit 9acde78 into main Oct 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant