Repository navigation
fix(rpc): clear the awaiting-input mark when a reload drops pending dialogs (rebased from #482) - #564
Merged
Merged
Conversation
…ialogs (rebased from #482)
Contributor
…63, untouched file)
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.
Rebased from #482 by OrwellVII: "fix(rpc): clear the awaiting-input mark when a reload drops pending dialogs".
What changed on rebase
The production fix from #482 is not carried over, because current
mainalready has the behavior it fixed. Since #482's base,mainreworkedclearPendingUiRequests()(lib/rpc-manager.ts) to settle every pending dialog throughsettlePendingUiRequest()instead of clearing the map in one go. Each settlement goes throughforgetPendingUiRequest(), which callsnotifyRunningChange(), so a reload that drops dialogs — including one whose spawn then fails — already broadcasts the clearedawaitingInputmark, and additionally retracts each dialog's notification. Re-applying #482's plainpendingUiRequests.clear()on top of that would have been a regression (lost notification retraction), so it was deliberately left out.What this PR does carry over from #482, translated to current
main:JSON.stringify({ type: "extension_ui_request", ... })lines, whichRpcProcess.receivenow drops (lines need thetenvelope, and the live dialog frame type isui_request). The translated tests emitompLine({ type: "ui_request", id, method, args })instead:get_stateread fails still clears the awaiting-input markargs[2], replay filter onui_request)AGENTS.mdnote (every dialog removal broadcasts a running change) and theCHANGELOG.mdline (the mark also clears when a reload drops the dialog) from fix(rpc): clear the awaiting-input mark when a reload drops pending dialogs #482, both still accurate against currentmain.Tests
bun test --parallel lib/rpc-manager.test.mjs: 178 pass, 0 fail, including the 3 translated tests above.npm run typecheck(tsc --noEmit): clean.Verified that the 3 translated tests pass on unmodified
mainat 5d7232a — i.e. they lock in behaviormainalready has, rather than fixing a live bug.Summary by CodeRabbit