fix: re-file the Quarto output cache when an untitled document is saved in web - #15331
Merged
Conversation
…ed in web The untitled->saved transition transfers the Quarto output cache to the saved document's URI, but required a `file` scheme. In a remote or web window a saved document is `vscode-remote`, so the transfer never ran and the cache stayed keyed to the untitled URI. Output still rendered right after the save because the content-hash fallback matched the live untitled cache in memory, but a window reload found nothing under the saved URI and restored no view zones. Accept any non-untitled scheme, and cover the rebind with a vitest.
|
E2E Tests 🚀 Why these tags?
More on automatic tags from changed files. |
midleman
force-pushed
the
mi/quarto-untitled-save-cache-rebind
branch
from
August 4, 2026 20:10
4046cbc to
a29ba3d
Compare
…matching branches The rebind tests only checked which URIs the cache service was called with, so a change that wrote the cache but dropped the in-memory re-attach would have passed. Assert the outputs land on the saved document too, and add the two matching partitions that had no coverage: a cell whose index shifted (matched by content-hash prefix) and a cached cell that matches nothing in the saved document. Drop the redundant workbench preset, which the contribution preset already implies.
midleman
force-pushed
the
mi/quarto-untitled-save-cache-rebind
branch
from
August 4, 2026 20:29
a29ba3d to
3cc342a
Compare
midleman
marked this pull request as draft
August 4, 2026 20:29
The vscode-remote and file cases were identical apart from the URI. Fold them into one it.each so the scheme-independence is stated rather than implied, and trim the file header and the rebind comment to the part the code cannot show.
midleman
marked this pull request as ready for review
August 4, 2026 23:14
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
When you run a Quarto cell, Positron saves a copy of the output to a cache filed under the document's address. Saving an untitled document with Save As is supposed to re-file that cache under the new filename, but the code only did so when the new address looked like a plain local file. In Positron Web and remote sessions a saved file has a different kind of address, so the cache stayed filed under "Untitled-1" and a window reload found nothing to restore, so the output vanished.
quartoOutputManagerSaveAs.vitest.tscovering the re-filing for a remote address, a local file, and untitled-to-untitledRelease Notes
New Features
Bug Fixes
Validation Steps
@:quarto @:web @:win
E2E Triage Diagnosis
🟢 High confidence -- CORRECTED (supersedes the parse-race summary below): on Save As the Quarto output cache is never rebound from the untitled URI to the saved document, because _transferCacheFromUntitled is gated on this._documentUri.scheme === (file) (quartoOutputManager.ts:391) and in web a saved document URI is vscode-remote. The post-save assertion still passes via the in-memory findCacheByContentHash fallback to the live untitled cache; that fallback cannot survive a window reload, so post-reload restore finds no cache under the saved URI and mints zero view zones.