Repository navigation
qt-qml: Reply to QML Preview file requests on errors - #620
Open
shyamnathp wants to merge 1 commit into
Open
shyamnathp wants to merge 1 commit into
shyamnathp wants to merge 1 commit into
Conversation
We found this while running a PySide6 file explorer example in QML Preview. The example lists the home directory, so Qt sends a Request to the extension for every path it visits. Reading ~/.Trash failed with "EPERM: operation not permitted, scandir". The exception skipped the reply, Qt kept waiting for an answer and the app froze. Catch the error, log it and answer with an Error command, so Qt continues.
shyamnathp
force-pushed
the
bug/vscodeext-preview-file-request
branch
from
November 18, 2026 13:51
67e61cf to
1a2cb93
Compare
OrkunTokdemir
approved these changes
Nov 18, 2026
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.
Description
Noticed when a PySide6 file explorer example was run in QML Preview. The example lists the home directory, so Qt sends a Request to the extension for every path it visits. Reading
~/.Trashfailed withEPERM: operation not permitted, scandir. The extension logged the failure but sent no reply. Qt waits for an answer to every Request, so the app froze.Cause: the
onPathRequestedlistener has no error handling. Any exception while handling a Request skips the reply.Fix: catch the error, log it, and answer with an Error command so Qt continues. Also track the loaded file in the path map and the file watcher.
A unit test covers the error reply (
QML Preview path request handling).QmlPreviewCommandis now exported so the test can build a Request packet.Related issue in JIRA
VSCODEEXT-361