Skip to content

Commit 694bed4

Browse files
fix(diff-view): close tabs on a clean buffer and stand the rollback down after the commit point
Three CodeRabbit threads on #1932 plus the two review rows they point at. Data Integrity & Integration (Critical, DiffViewProvider.ts:691): "revertChanges() can delete a file that this edit never created ... reset() (Lines 1213-1241) does not clear relPath ... That is exactly the state that takes the new-file branch: fileExists is false, the if (this.activeDiffEditor) block is skipped, and removeCreatedFile(absolutePath) runs fs.unlink." reset() now clears relPath and newContent, so no path survives its session, and the regression test the thread asked for proves revertChanges() after reset() never reaches fs.unlink. Deliberate deviation, recorded because it is a scope call rather than an oversight: the thread's other half - gating the rollback on an active edit session - is NOT taken here. That guard belongs to #1931's shape of revertChanges() (5c0f212), which lands before this unit in the merge order; carrying a second shape of the same guard in the last unit is how one method ends up with two. It is filed as a follow-up against #1931's next push, and the tests here record the current behaviour rather than the desired one. Functional Correctness (Minor, writeToFileTool.spec.ts:1344): "Both 'keeps approved diff content' tests assert only revertChanges not called, so they always pass ... A regression that discards the user's approved edit would pass both tests." Both now assert on discardUnapprovedStream(), the method the error path actually calls. Maintainability (Minor, writeToFileTool.spec.ts:957): "Two new early-release tests check off with expect.any(Function). They still pass if the tool removes a different function." Both sites capture the registered listener and assert off with that reference. Maintainability (Trivial, writeToFileTool-partial-state-cleanup.spec.ts:196): "Every rollback test here makes discardUnapprovedStream reject. No test proves that a successful discard stays silent." Added for both teardown boundaries; they kill the return-true and if (!reverted) survivors the mutation advisory named. Ported from the units that land before this one, so the chain converges on one shape: - 5c0f212 (#1931): discardFileTab() restores the pre-stream buffer and saves it clean BEFORE closing, and close() is called without its second argument - that parameter is preserveFocus, not a force-discard flag, so a dirty tab was silently refused while the rollback kept deleting the file underneath it. saveBufferClean() comes with it. - 2a9bfab (#1931): saveChanges() takes an onCommit signal raised at the document save, and execute() stands the rollback down once it fires. saveDirectly() commits when it returns, because performing the write is what it does. - 8084eab (#1929): saveChanges() releases placeholderPath only after the approved save lands, so a rejected save leaves the discard something to remove. Security & Privacy (Major, WriteToFileTool.ts:315): "If handlePartial() opened the denied path before the final block, the denial branch clears only task stream state. It does not revert the streamed content or reset the diff view." The rooignore denial now runs the same discard-then-reset teardown as the other boundaries. The two missing-parameter returns are corrected in the reply on that thread - they did already reset - but neither discarded what an earlier delta had streamed, so they run the same helper now. Negative controls (Buffer snapshots, sha256 a1fa0dd263514c5c provider / 49b07146e60b1f4a tool, verified after every mutant): forced close restored -> 2 red; no saveBufferClean -> 1 red; reset() keeping relPath -> 1 red; commit point raised on return -> 1 red; placeholder released before the save -> 1 red; rooignore branch not tearing the view down -> 1 red; either missing-parameter branch back to a bare reset() -> 1 red each; commit point never wired -> 1 red; detach passing a different function -> 9 red; cleanup always reporting -> 1 red; parse-failure teardown always reporting -> 1 red. Two mutants are equivalent and carry documented Stryker directives: dropping writeCommitted after saveDirectly, and shortening the catch guard to !writeApproved - on this unit the approval flag already stands the rollback down on every path the commit point can be reached from. Local: sweep (core/tools, integrations/editor, core/task, core/webview) 97 files / 2002 passed / 5 skipped; tsc --noEmit 0 with the local @roo-code/types paths override; eslint . --ext=ts --max-warnings=0 exit 0; prettier --check clean on all five files and on the current refs/pull/1932/merge (9dcf3d8, 0 dirty); eslint-suppressions.json untouched; it( 65 -> 68, 95 -> 98, 9 -> 11, no removals.
1 parent cda6aea commit 694bed4

5 files changed

Lines changed: 291 additions & 22 deletions

File tree

‎src/core/tools/WriteToFileTool.ts‎

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,10 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
284284

285285
// Returning here skips the cleanup below: release THIS task's stream state (and
286286
// only this task's) so the abort listener and any streamFailed guard do not outlive
287-
// the call.
287+
// the call, and tear down the diff view an earlier streaming delta may have opened -
288+
// otherwise its unapproved content sits in the editor until the next write.
288289
this.resetTaskPartialState(task)
289-
await task.diffViewProvider.reset()
290+
await this.cleanupFailedPartialStream(task)
290291
return
291292
}
292293

@@ -297,9 +298,9 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
297298

298299
// Returning here skips the cleanup below: release THIS task's stream state (and
299300
// only this task's) so the abort listener and any streamFailed guard do not outlive
300-
// the call.
301+
// the call, and tear down the diff view an earlier streaming delta may have opened.
301302
this.resetTaskPartialState(task)
302-
await task.diffViewProvider.reset()
303+
await this.cleanupFailedPartialStream(task)
303304
return
304305
}
305306

@@ -311,13 +312,23 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
311312

312313
// Returning here skips the cleanup below: release THIS task's stream state (and
313314
// only this task's) so the abort listener and any streamFailed guard do not outlive
314-
// the call.
315+
// the call. The denial can arrive after a streaming delta opened the denied path and
316+
// streamed unapproved content into it, so the diff view is torn down here too - the
317+
// write never happens, and a later save of that editor would land it anyway.
315318
this.resetTaskPartialState(task)
319+
await this.cleanupFailedPartialStream(task)
316320
return
317321
}
318322

319323
const isWriteProtected = task.rooProtectedController?.isWriteProtected(relPath) || false
320324

325+
// The point of no return for this write. saveChanges() persists the document and then keeps
326+
// working (closing the diff views, tab bookkeeping, diagnostics), and trackFileContext() and
327+
// pushToolWriteResult() run after it, so a rejection past this point must not roll back a
328+
// write the user already approved: the rollback would restore the previous content, or delete
329+
// a file that was created and saved. Set only once the durable write has landed.
330+
let writeCommitted = false
331+
321332
let fileExists: boolean
322333
const absolutePath = path.resolve(task.cwd, relPath)
323334

@@ -409,6 +420,13 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
409420
writeApproved = true
410421

411422
await task.diffViewProvider.saveDirectly(relPath, newContent, false, diagnosticsEnabled, writeDelayMs)
423+
// saveDirectly() performs the write itself and reports a failing write, so returning means
424+
// the content is on disk: from here the rollback has to stand down.
425+
// Stryker disable next-line AssignmentExpression: equivalent on this path - the
426+
// approval flag already stands the rollback down, so removing the assignment changes no
427+
// observable behaviour today. It stays because this branch lands the write without a diff
428+
// view, and the commit point is the fact that says so.
429+
writeCommitted = true
412430
} else {
413431
if (!task.diffViewProvider.isEditing) {
414432
const partialMessage = JSON.stringify(sharedMessageProps)
@@ -442,7 +460,12 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
442460

443461
writeApproved = true
444462

445-
await task.diffViewProvider.saveChanges(diagnosticsEnabled, writeDelayMs)
463+
await task.diffViewProvider.saveChanges(diagnosticsEnabled, writeDelayMs, () => {
464+
// Signalled by saveChanges() at the document save, not when it returns: the editor
465+
// bookkeeping and diagnostics that follow can still reject, and by then the file has
466+
// already landed.
467+
writeCommitted = true
468+
})
446469
}
447470

448471
if (relPath) {
@@ -477,7 +500,14 @@ export class WriteToFileTool extends BaseTool<"write_to_file"> {
477500
// is the user's accepted edit -- keep it in the editor (dirty) so they can
478501
// save it manually.
479502
let reverted = true
480-
if (!writeApproved) {
503+
// Two independent stand-downs: the user approved this content, or the write is already
504+
// durable. Either one makes a rollback undo something the user wanted rather than
505+
// cleaning up this call's debris.
506+
// Stryker disable next-line LogicalOperator: writeCommitted is the second, independent
507+
// stand-down - every path that sets it has already set writeApproved, so no test can tell &&
508+
// from || here. It stays because it names the durable fact the provider signals at the
509+
// save, not the approval fact, and it is the guard that survives if the approval flag moves.
510+
if (!writeApproved && !writeCommitted) {
481511
reverted = await this.discardUnapprovedStreamBeforeReset(task)
482512
}
483513
await this.resetDiffViewAfterWrite(task)

‎src/core/tools/__tests__/writeToFileTool-partial-state-cleanup.spec.ts‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,41 @@ describe("WriteToFileTool per-task partial-state cleanup", () => {
195195
errorSpy.mockRestore()
196196
})
197197

198+
it("stays silent when the failed-stream cleanup restored the editor", async () => {
199+
// Every other case here makes the discard reject, so a cleanup that warned after EVERY
200+
// restore still passed. "The editor may hold content you never approved" is only true when
201+
// the restore failed; saying it regardless trains the user to ignore the warning.
202+
const task = buildTask("failed-stream-clean", "inst-10")
203+
const t = task as unknown as CleanupTask
204+
205+
await writeToFileTool["cleanupFailedPartialStream"](task)
206+
207+
expect(t.diffViewProvider.discardUnapprovedStream).toHaveBeenCalledTimes(1)
208+
expect(t.diffViewProvider.reset).toHaveBeenCalledTimes(1)
209+
expect(t.say).not.toHaveBeenCalled()
210+
})
211+
212+
it("stays silent when the parse-failure teardown restored the editor", async () => {
213+
// The same contract on the other teardown boundary: a completed restore is not a hazard,
214+
// so nothing is reported and the incidental parse error is left to the caller.
215+
const task = buildTask("parse-failure-clean", "inst-11")
216+
const t = task as unknown as CleanupTask
217+
writeToFileTool["getTaskPartialStreamState"](task)
218+
const handleError = vi.fn().mockResolvedValue(undefined)
219+
220+
const handled = await writeToFileTool["onParameterParseFailure"](
221+
task,
222+
{ handleError } as unknown as Parameters<(typeof writeToFileTool)["onParameterParseFailure"]>[1],
223+
new Error("parameter parse failed"),
224+
)
225+
226+
expect(t.diffViewProvider.discardUnapprovedStream).toHaveBeenCalledTimes(1)
227+
expect(t.say).not.toHaveBeenCalled()
228+
expect(handleError).not.toHaveBeenCalled()
229+
expect(handled).toBe(false)
230+
expect(writeToFileTool["taskPartialStreamState"].size).toBe(0)
231+
})
232+
198233
it("logs and continues when finalizing the open partial ask fails", async () => {
199234
const task = buildTask("finalize-fails", "inst-5")
200235
const t = task as unknown as CleanupTask

‎src/core/tools/__tests__/writeToFileTool.spec.ts‎

Lines changed: 87 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,13 @@ describe("writeToFileTool", () => {
954954
await executeWriteFileTool({}, { accessAllowed: false })
955955

956956
expect(writeToFileTool["taskPartialStreamState"].size).toBe(0)
957-
expect(mockCline.off).toHaveBeenCalledWith(RooCodeEventName.TaskAborted, expect.any(Function))
957+
// The teardown has to detach the function this tool registered; expect.any(Function)
958+
// also passes when a different callback is removed and the real one keeps firing.
959+
const abortListener = mockCline.once.mock.calls.find(
960+
([event]: unknown[]) => event === RooCodeEventName.TaskAborted,
961+
)?.[1]
962+
expect(abortListener).toBeInstanceOf(Function)
963+
expect(mockCline.off).toHaveBeenCalledWith(RooCodeEventName.TaskAborted, abortListener)
958964
})
959965

960966
it("releases the per-task stream state when a missing parameter returns early", async () => {
@@ -968,6 +974,12 @@ describe("writeToFileTool", () => {
968974
})
969975

970976
expect(writeToFileTool["taskPartialStreamState"].size).toBe(0)
977+
// An earlier delta may have opened the diff view for this call: the early return has
978+
// to discard its unapproved content before reset() drops the state that discard reads.
979+
expect(mockCline.diffViewProvider.discardUnapprovedStream).toHaveBeenCalledTimes(1)
980+
expect(mockCline.diffViewProvider.discardUnapprovedStream.mock.invocationCallOrder[0]).toBeLessThan(
981+
mockCline.diffViewProvider.reset.mock.invocationCallOrder[0],
982+
)
971983
expect(mockCline.diffViewProvider.reset).toHaveBeenCalled()
972984
})
973985

@@ -1002,9 +1014,32 @@ describe("writeToFileTool", () => {
10021014
)?.[1]
10031015
expect(abortListener).toBeInstanceOf(Function)
10041016
expect(mockCline.off).toHaveBeenCalledWith(RooCodeEventName.TaskAborted, abortListener)
1005-
// A stream may have opened a diff view for this call; the early return still closes it.
1017+
// A stream may have opened a diff view for this call; the early return discards
1018+
// its unapproved content first, then closes it.
1019+
expect(mockCline.diffViewProvider.discardUnapprovedStream).toHaveBeenCalledTimes(1)
1020+
expect(mockCline.diffViewProvider.discardUnapprovedStream.mock.invocationCallOrder[0]).toBeLessThan(
1021+
mockCline.diffViewProvider.reset.mock.invocationCallOrder[0],
1022+
)
10061023
expect(mockCline.diffViewProvider.reset).toHaveBeenCalled()
10071024
})
1025+
1026+
it("discards the streamed preview when a rooignore denial returns early", async () => {
1027+
// The denial can arrive after a streaming delta opened the denied path and streamed
1028+
// content into it. This branch reported the denial and released the stream state, but
1029+
// never touched the diff view: the unapproved content sat in a saveable editor, and the
1030+
// provider kept this call's editType/relPath for whatever write came next.
1031+
await executeWriteFileTool({}, { isPartial: true })
1032+
1033+
await executeWriteFileTool({}, { accessAllowed: false })
1034+
1035+
expect(mockCline.say).toHaveBeenCalledWith("rooignore_error", testFilePath)
1036+
expect(mockCline.diffViewProvider.discardUnapprovedStream).toHaveBeenCalledTimes(1)
1037+
expect(mockCline.diffViewProvider.discardUnapprovedStream.mock.invocationCallOrder[0]).toBeLessThan(
1038+
mockCline.diffViewProvider.reset.mock.invocationCallOrder[0],
1039+
)
1040+
expect(mockCline.diffViewProvider.reset).toHaveBeenCalledTimes(1)
1041+
expect(mockCline.diffViewProvider.saveChanges).not.toHaveBeenCalled()
1042+
})
10081043
})
10091044

10101045
describe("user interaction", () => {
@@ -1341,7 +1376,31 @@ describe("writeToFileTool", () => {
13411376

13421377
expect(mockHandleError).toHaveBeenCalledWith("writing file", expect.any(Error))
13431378
expect(mockCline.diffViewProvider.saveChanges).toHaveBeenCalled()
1344-
expect(mockCline.diffViewProvider.revertChanges).not.toHaveBeenCalled()
1379+
// The error path restores through discardUnapprovedStream(), not revertChanges(), so the
1380+
// discard is the call that would have thrown the approved edit away.
1381+
expect(mockCline.diffViewProvider.discardUnapprovedStream).not.toHaveBeenCalled()
1382+
expect(mockCline.diffViewProvider.reset).toHaveBeenCalled()
1383+
})
1384+
1385+
it("does not roll back a write whose commit point has already passed", async () => {
1386+
// saveChanges() signals the commit point at the document save and then keeps working
1387+
// (closing the diff views, tab bookkeeping, diagnostics). A rejection in that tail is a
1388+
// failure AFTER a durable write: rolling back here would restore the previous content or
1389+
// delete a file the user had just approved being created.
1390+
let signalledAtTheSave = false
1391+
mockCline.diffViewProvider.saveChanges.mockImplementationOnce(async (...args: unknown[]) => {
1392+
const onCommit = args[2] as (() => void) | undefined
1393+
signalledAtTheSave = typeof onCommit === "function"
1394+
onCommit?.()
1395+
throw new Error("closeAllDiffViews rejected")
1396+
})
1397+
1398+
await executeWriteFileTool({}, { fileExists: false })
1399+
1400+
// The stand-down only works if execute() actually handed saveChanges() the signal.
1401+
expect(signalledAtTheSave).toBe(true)
1402+
expect(mockHandleError).toHaveBeenCalledWith("writing file", expect.any(Error))
1403+
expect(mockCline.diffViewProvider.discardUnapprovedStream).not.toHaveBeenCalled()
13451404
expect(mockCline.diffViewProvider.reset).toHaveBeenCalled()
13461405
})
13471406

@@ -1598,14 +1657,31 @@ describe("writeToFileTool", () => {
15981657
expect(mockHandleError).toHaveBeenCalledWith("writing file", expect.any(Error))
15991658
expect(mockCline.finalizePartialToolAsk).toHaveBeenCalledWith(undefined)
16001659
expect(mockCline.diffViewProvider.saveDirectly).toHaveBeenCalled()
1601-
expect(mockCline.diffViewProvider.revertChanges).not.toHaveBeenCalled()
1660+
// discardUnapprovedStream() is what the error path actually calls; asserting only on
1661+
// revertChanges() could never fail.
1662+
expect(mockCline.diffViewProvider.discardUnapprovedStream).not.toHaveBeenCalled()
16021663
expect(mockCline.diffViewProvider.reset).toHaveBeenCalled()
16031664
expect(mockCline.didEditFile).toBe(false)
16041665
} finally {
16051666
consoleErrorSpy.mockRestore()
16061667
}
16071668
})
16081669

1670+
it("does not roll back a write that saveDirectly already landed", async () => {
1671+
// The prevent-focus-disruption branch never opens a diff view: saveDirectly() performs
1672+
// the write itself, so returning means the content is on disk. A failure in what follows
1673+
// (tracking the file, building the result) must not run the rollback over a landed write.
1674+
enablePreventFocusDisruption()
1675+
mockCline.fileContextTracker.trackFileContext.mockRejectedValueOnce(new Error("tracker down"))
1676+
1677+
await executeWriteFileTool({}, { fileExists: false })
1678+
1679+
expect(mockCline.diffViewProvider.saveDirectly).toHaveBeenCalledTimes(1)
1680+
expect(mockHandleError).toHaveBeenCalledWith("writing file", expect.any(Error))
1681+
expect(mockCline.diffViewProvider.discardUnapprovedStream).not.toHaveBeenCalled()
1682+
expect(mockCline.diffViewProvider.reset).toHaveBeenCalled()
1683+
})
1684+
16091685
it("skips streaming diff view work when the experiment is enabled", async () => {
16101686
// With the experiment enabled the tool preview is embedded in the complete message
16111687
// built in execute(), so handlePartial must not open or update the diff view while
@@ -1634,7 +1710,13 @@ describe("writeToFileTool", () => {
16341710

16351711
expect(mockCline.ask).not.toHaveBeenCalled()
16361712
expect(writeToFileTool["taskPartialStreamState"].size).toBe(0)
1637-
expect(mockCline.off).toHaveBeenCalledWith(RooCodeEventName.TaskAborted, expect.any(Function))
1713+
// Delta 1 registered the listener; delta 2 must detach THAT function, not merely
1714+
// some function with the right name.
1715+
const abortListener = mockCline.once.mock.calls.find(
1716+
([event]: unknown[]) => event === RooCodeEventName.TaskAborted,
1717+
)?.[1]
1718+
expect(abortListener).toBeInstanceOf(Function)
1719+
expect(mockCline.off).toHaveBeenCalledWith(RooCodeEventName.TaskAborted, abortListener)
16381720
})
16391721

16401722
it("clears the provider state when prevent-focus approval is denied", async () => {

‎src/integrations/editor/DiffViewProvider.ts‎

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ export class DiffViewProvider {
343343
async saveChanges(
344344
diagnosticsEnabled: boolean = true,
345345
writeDelayMs: number = DEFAULT_WRITE_DELAY_MS,
346+
onCommit?: () => void,
346347
): Promise<{
347348
newProblemsMessage: string | undefined
348349
userEdits: string | undefined
@@ -353,16 +354,25 @@ export class DiffViewProvider {
353354
}
354355

355356
const absolutePath = path.resolve(this.cwd, this.relPath)
356-
// The write below is the approved one: whatever placeholder open() created at this path
357-
// becomes real content, so it is no longer an artifact this edit may remove.
358-
this.placeholderPath = undefined
359357
const updatedDocument = this.activeDiffEditor.document
360358
const editedContent = updatedDocument.getText()
361359

362360
if (updatedDocument.isDirty) {
363361
await updatedDocument.save()
364362
}
365363

364+
// The write is irreversible from here: a clean document already matches disk, and a saved
365+
// one has landed. Everything below (closing the diff views, tab bookkeeping, diagnostics)
366+
// can still reject, and a caller that rolls the tool call back after this point would undo
367+
// a write the user approved - so it is told, at the commit point rather than on return.
368+
onCommit?.()
369+
370+
// Ownership is released only once the approved write has landed. A save that rejects leaves
371+
// the placeholder as open() created it, and the caller's teardown still has to remove it:
372+
// clearing it here would tell discardUnapprovedStream() that nothing this edit created is
373+
// left to clean, and an empty or half-written new file would survive the failed write.
374+
this.placeholderPath = undefined
375+
366376
// Stop tracking touches and cancel any pending scroll-to-diff before any
367377
// programmatic editor activation below.
368378
this.disposeActiveEditorListener()
@@ -1065,18 +1075,24 @@ export class DiffViewProvider {
10651075
)
10661076

10671077
for (const tab of tabs) {
1078+
// tabGroups.close()'s second argument is preserveFocus, not a force-discard flag: a
1079+
// dirty tab prompts or is refused, which is how unapproved streamed content survived a
1080+
// "forced" close. Restore the buffer to its pre-stream content and save it clean first,
1081+
// so close() never sees a dirty tab and nothing unapproved reaches disk.
1082+
await this.restorePreStreamBuffer(absolutePath)
1083+
await this.saveBufferClean(absolutePath)
1084+
10681085
let closed: boolean
10691086
let closeError: Error | undefined
10701087
try {
1071-
closed = await vscode.window.tabGroups.close(tab, true)
1088+
closed = await vscode.window.tabGroups.close(tab)
10721089
} catch (error) {
10731090
closed = false
10741091
closeError = error instanceof Error ? error : new Error(String(error))
10751092
}
10761093
if (!closed) {
1077-
await this.restorePreStreamBuffer(absolutePath)
10781094
throw new Error(
1079-
`Rollback could not discard the buffer for ${absolutePath}; its unapproved content was restored to the pre-stream state instead.`,
1095+
`Rollback could not close the restored buffer for ${absolutePath}; its content was put back to the pre-stream state but the tab is still open.`,
10801096
{ cause: closeError },
10811097
)
10821098
}
@@ -1100,6 +1116,20 @@ export class DiffViewProvider {
11001116
await vscode.workspace.applyEdit(edit)
11011117
}
11021118

1119+
/**
1120+
* Persist a restored buffer so the tab is clean before it is closed: close() refuses or prompts
1121+
* on a dirty tab, and a refused close is how unapproved content outlived a "forced" rollback.
1122+
* The content being saved here is the pre-stream content, never the streamed partial.
1123+
*/
1124+
private async saveBufferClean(absolutePath: string): Promise<void> {
1125+
const document = vscode.workspace.textDocuments.find(
1126+
(document) => document.uri.scheme === "file" && arePathsEqual(document.uri.fsPath, absolutePath),
1127+
)
1128+
if (document?.isDirty) {
1129+
await document.save()
1130+
}
1131+
}
1132+
11031133
private async closeFileTab(absolutePath: string): Promise<void> {
11041134
const tabs = vscode.window.tabGroups.all
11051135
.flatMap((group) => group.tabs)
@@ -1364,6 +1394,11 @@ export class DiffViewProvider {
13641394
await this.closeAllDiffViews()
13651395
this.editType = undefined
13661396
this.isEditing = false
1397+
// A session's path must not outlive the session: revertChanges() reads relPath to decide
1398+
// what to roll back, and a stale relPath with editType cleared points the next rollback at
1399+
// whatever file this provider last touched - a file the current edit never created.
1400+
this.relPath = undefined
1401+
this.newContent = undefined
13671402
this.originalContent = undefined
13681403
this.createdDirs = []
13691404
this.placeholderPath = undefined

0 commit comments

Comments
 (0)