Closed benjamin-t-santos closed 1 week ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.99%. Comparing base (
f5ca8cc
) to head (de97307
). Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@traeok Thanks for the review. Is it possible to include this fix in the v3.0.3 release?
@traeok Thanks for the review. Is it possible to include this fix in the v3.0.3 release?
@zFernand0 @t1m0thyj @adam-wolfe what do y'all think too? I believe we are including a similar fix for another tree.
@zFernand0 @t1m0thyj @adam-wolfe what do y'all think too? I believe we are including a similar fix for another tree.
@JillieBeanSim This fix looks like a simple one that would be good to include 👍
thanks I will get it ported
Proposed changes
Extenders can fetch a USS resource on demand using
vscode.workspace.fs.stat()
with thefetch=true
query. When done with a USS file that has not expanded in the USS tree view, Zowe Explorer gets stuck in an infinite loop of callingstat()
over and over again. Here's how it happens:vscode.workspace.fs.stat()
is called for a USS resource with the fetch query set to true. Example:vscode.workspace.fs.stat(zowe-uss:/zosmf/user/test.txt)
UssFSProvider.remoteLookupForResource()
is called to fetch the file from the host.UssFSProvider.fetchEntries()
.fetchEntries()
checks if the parent directory of the requested file is in the file system. If it's not,await vscode.workspace.fs.createDirectory(parentUri)
is called on line 191 to create it.stat()
is called again for theparentUri
with afetch=true
query as a result of callingvscode.workspace.fs.createDirectory()
. (I believe this is due to the VS Code file system base implementation. It surprised me but looking at the call stack that is what I see)UssFSProvider.remoteLookupForResource()
is called to fetch the directory from the host. This eventually callsUssFSProvider.fetchEntries()
listFiles()
is called infetchEntries()
, if the resource requested is a directory that does not already exist in the file system, we callvscode.workspace.fs.createDirectory()
with the directory's URI. This is the same exact URI that is used when callingcreateDirectory()
in step 3.Basically, Zowe Explorer keeps calling
vscode.workspace.fs.createDirectory()
for the parent of the requested file over and over again without ever resolving. This does not happen when using tree views because of how directories are expanded from the top-down. In this case, I as an extender am requesting a file from a parent directory that has not been created.There are improvements we can make to improve the
UssFSProvider
for extenders, but with the goal of trying to get a fix for this issue into the v3.0.3 release, I tried to keep my changes minimal. I added code that sets the query of theparentUri
to an empty string when callingvscode.workspace.fs.createDirectory()
infetchEntries()
. This prevents it from entering the infinite loop by not trying to fetch the requested resource's parent.This change will not impact the tree view, as those views do not make use of the fetch query. This change will only fix functionality for extenders.
Release Notes
Milestone:
Changelog:
Types of changes
Checklist
General
yarn workspace vscode-extension-for-zowe vscode:prepublish
pnpm --filter vscode-extension-for-zowe vscode:prepublish
Code coverage
Deployment
Further comments