Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infinite loop when fetching USS resources with stat() #3321

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading