Fix issue reporter wizard dropping preset extension data#320103
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression in the new wizard-based issue reporter (IssueReporterOverlay) where programmatic invocations of workbench.action.openIssueReporter with a preset extensionId would drop the caller-provided extension data / uri / privateUri, causing that context to be missing from the generated issue body (e.g. Copilot NES feedback flow).
Changes:
- When
updateSelectedExtension(..., /* loadExtensionData */ false)is used, propagate caller-supplieddata/uri/privateUrionto the selected extension and into the model via the existingapplyExtensionIssueDatahelper. - Add a guard intended to avoid re-applying that payload when the extension list is later repopulated asynchronously.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/issue/browser/issueReporterOverlay.ts | Ensures preset extension payload (data/uri/privateUri) is not dropped when the wizard is opened programmatically with loadExtensionData=false. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 1
| if (issueData) { | ||
| this.applyExtensionIssueData(extension, issueData); | ||
| } | ||
| } else if (!extension.data && (this.data.data !== undefined || this.data.uri !== undefined || this.data.privateUri !== undefined)) { |
8d87b16 to
3c97415
Compare
|
Force-pushed a correction. The previous version guarded with Switched the guard to |
3c97415 to
cc9e7e1
Compare
|
Found a deeper bug. Force-pushed. When the wizard opens, the constructor calls
Once cleared, the catch-up retry in Fix: preserve the originally requested |
The new IssueReporterOverlay wizard dropped the `data` payload provided via `workbench.action.openIssueReporter` when an `extensionId` was also preset. This broke callers like Copilot's NES feedback flow, which attaches an STest and recording context via the `data` that context was silently lostfield from the resulting issue body. The constructor calls `updateSelectedExtension(extensionId, /* loadExtensionData */ false)`. With `loadExtensionData=false`, the existing `applyExtensionIssueData` path that propagates `data` onto the selected extension and into the model (`extensionData` + `includeExtensionData`) was never invoked. Fix: in `updateSelectedExtension`, when `loadExtensionData=false` but the caller-supplied `this.data` carries `data`/`uri`/`privateUri`, apply it when `updateExtensionOptions` re-invokes `updateSelectedExtension` after `updateModel` repopulates `allExtensions`. Fixes microsoft#320101 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
cc9e7e1 to
89df1e1
Compare
|
Pushed follow-ups for the two issues spotted after the payload started arriving:
cc @Giuspepe |
Update: how the new wizard handles oversize extension dataFor posterity, the new wizard's overflow handling lives in
So the upload-as-attachment behavior the old reporter had is preserved; the bug fixed by #320103 is strictly about the preset |
Fixes #320101
The new
IssueReporterOverlaywizard dropped thedatapayload provided via theworkbench.action.openIssueReportercommand when anextensionIdwas also preset. This broke callers like Copilot's NES feedback flow, which attaches an STest and recording context via thedatathat context was silently lost from the resulting issue body.fieldRoot cause
The constructor calls
updateSelectedExtension(extensionId, /* loadExtensionData */ false). WithloadExtensionData=false, the existingapplyExtensionIssueDatapath that propagatesdataonto the selected extension and into the model (extensionData+includeExtensionData) was never invoked. The old reporter (baseIssueReporterService.updateExtensionStatus) did this propagation; the new wizard didn't.Fix
In
updateSelectedExtension, whenloadExtensionData=falsebut the caller-suppliedthis.datacarriesdata/uri/privateUri, apply it via the same helper. Guarded by!extension.dataso it doesn't re-apply whenupdateExtensionOptionsre-invokesupdateSelectedExtensionafterupdateModelrepopulatesallExtensions(covers the case where the extension list arrives asynchronously after the wizard is already built).User-driven selections from the dropdown / source buttons are they call
updateSelectedExtensionwith the defaultloadExtensionData=true, taking the existingifbranch.unaffectedcc @Giuspepe