fix(question): register answer channel before prompt event#53
Open
cursor[bot] wants to merge 2 commits intomainfrom
Open
fix(question): register answer channel before prompt event#53cursor[bot] wants to merge 2 commits intomainfrom
cursor[bot] wants to merge 2 commits intomainfrom
Conversation
Co-authored-by: cooper <czxtm@users.noreply.github.com>
📋 PR Overview
|
Contributor
|
This seems valid but the suggested PR fails the build, so I will pull it and fix it up. |
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.
Summary
Fixes a race introduced by the oneshot question-response refactor. The evolve loop previously emitted the question event before registering the pending oneshot sender, so a fast UI choice could call
darwin_evolve_answerwhile no pending question existed. That rejected the answer, the UI marked it answered, and the backend could wait indefinitely.This registers the response receiver before emitting the question event and then awaits that prepared receiver.
Test Plan
prepared_question_response_accepts_immediate_answerregression coverage.cargo +stable test prepared_question_response_accepts_immediate_answerin the Linux cloud environment. It is blocked by existing unrelated Linux build errors in Tauri window code (hidden_title,RunEvent::Reopen, andunused variable: windowunderunused = deny).cargo +stable test --lib ...is not available because the package has no library target.Docs