Repository navigation
Commit 0774d46
committed
fix(editor): release abandoned diff streams and owned placeholders (split 5/6 of #1066, unit U6a)
Diff-view half of #1932 replayed onto main tip 53cb5b5: discardUnapprovedStream
and discardOwnedPlaceholder cover streams that were abandoned, changed out from
under a retained session, or left by an unconfirmed save; isEditingDifferentPath
guards a second path while a session is retained, and placeholderPath stays owned
until the rollback removes it. The tool-side half moves to its own unit; plan and
measured widths in #1937 (comment).
The spec keeps its dirty-flag assignments legal after upstream rewrote the doubles
with the typed test-utils helpers: one locally widened ActiveDiffEditor type on the
shared builder instead of eight assertions, because vscode types TextDocument.isDirty
as read-only.
Review pass on the CodeRabbit change-request filed at this head: a refused buffer restore
now stops the rollback outright the same way an unconfirmed save of the restored buffer
does, so the tabs stay open, nothing is unlinked and the placeholder keeps its owner -- the
spec for that path now requires that no unlink happens instead of asserting one. The
commit-point test seeds placeholderPath so its release assertion can fail, and
isEditingDifferentPath / editingRelPath are pinned directly (retained path accepted, another
path rejected, no normalisation) because every other call site stands in for that predicate
with a double. Threads: #1932 (comment)
and #2434 (comment).
Second review round on the shipped head: a rejected buffer restore or save now holds the artifact sweep as
firmly as a refused one does, so the placeholder and the created directories stay owned and on disk and the
directory snapshot goes back to the session - which is what tells the caller-side guard to keep the session
for a retry instead of resetting it away. Only a confirmed buffer outcome lets the sweep run, so a tab-close
failure on an already-restored buffer still removes the artifacts. The contract test that pinned the old
behaviour (sweep anyway when applyEdit rejects) is replaced by tests for both rejected awaits, and the
owned-placeholder release test now asserts the released state through the public ownsPlaceholder getter.
Threads: #1932 (comment) and
#1932 (comment).1 parent 53cb5b5 commit 0774d46
2 files changed
Lines changed: 1827 additions & 59 deletions
0 commit comments