Repository navigation
Fix "Question not found" when closing decision tickets asked on another Mac - #242
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.createdevents, so the main Mac got the ticket without its question.closeHumanTask→answerQuestionthen 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
tsc --noEmitclean.