Skip to content

Commit

Permalink
Fix infinite loop when fetching USS resources with stat() (#3321)
Browse files Browse the repository at this point in the history
* remove query when looking up parent

Signed-off-by: Benjamin Santos <[email protected]>

* remove leftover comment

Signed-off-by: Benjamin Santos <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Benjamin Santos <[email protected]>

---------

Signed-off-by: Benjamin Santos <[email protected]>
  • Loading branch information
benjamin-t-santos authored Nov 15, 2024
1 parent 91d4aaf commit 7143336
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/zowe-explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All notable changes to the "vscode-extension-for-zowe" extension will be documen
- Fixed issue where users were not prompted to enter credentials if a 401 error was encountered when opening files, data sets or spools in the editor. [#3197](https://github.com/zowe/zowe-explorer-vscode/issues/3197)
- Fixed issue where profile credential updates or token changes were not reflected within the filesystem. [#3289](https://github.com/zowe/zowe-explorer-vscode/issues/3289)
- Fixed issue to update the success message when changing authentication from token to basic through the 'Change Authentication' option.
- Fixed an issue where fetching a USS file using `UssFSProvider.stat()` with a `fetch=true` query would cause Zowe Explorer to get stuck in an infinite loop.

## `3.0.2`

Expand Down
4 changes: 2 additions & 2 deletions packages/zowe-explorer/src/trees/uss/UssFSProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class UssFSProvider extends BaseProvider implements vscode.FileSystemProv
response = await ZoweExplorerApiRegister.getUssApi(profile).fileList(ussPath);
// If request was successful, create directories for the path if it doesn't exist
if (response.success && !keepRelative && response.apiResponse.items?.[0]?.mode?.startsWith("d") && !this.exists(uri)) {
await vscode.workspace.fs.createDirectory(uri);
await vscode.workspace.fs.createDirectory(uri.with({ query: "" }));
}
} catch (err) {
if (err instanceof Error) {
Expand Down Expand Up @@ -187,7 +187,7 @@ export class UssFSProvider extends BaseProvider implements vscode.FileSystemProv
let parentDir = this._lookupParentDirectory(uri, true);
if (parentDir == null) {
const parentPath = path.posix.join(uri.path, "..");
const parentUri = uri.with({ path: parentPath });
const parentUri = uri.with({ path: parentPath, query: "" });
await vscode.workspace.fs.createDirectory(parentUri);
parentDir = this._lookupParentDirectory(uri, false);
parentDir.metadata = this._getInfoFromUri(parentUri);
Expand Down

0 comments on commit 7143336

Please sign in to comment.