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 endless recursive retries to read member if it exists but fails to be read #2560

Merged
merged 1 commit into from
Mar 6, 2025
Merged
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
19 changes: 7 additions & 12 deletions src/filesystems/qsys/QSysFs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,25 @@ export class QSysFS implements vscode.FileSystemProvider {
memberContent = this.extendedMemberSupport ?
await this.extendedContent.downloadMemberContentWithDates(uri) :
await contentApi.downloadMemberContent(library, file, member);
}
catch (error) {
if (await this.stat(uri)) { //Check if exists on an iASP and retry if so
return this.readFile(uri);
} catch (error) {
if (!retrying && await this.stat(uri)) { //Check if exists on an iASP and retry if so
return this.readFile(uri, true);
}
throw error;
}
if (memberContent !== undefined) {
return new Uint8Array(Buffer.from(memberContent, `utf8`));
}
else {
} else {
throw new FileSystemError(`Couldn't read ${uri}; check IBM i connection.`);
}
}
else {
} else {
if (retrying) {
throw new FileSystemError("Not connected to IBM i");
}
else {
} else {
if (await reconnectFS(uri)) {
this.updateMemberSupport(); //this needs to be done right after reconnecting, before the member is read (the connect event may be triggered too late at this point)
return this.readFile(uri, true);
}
else {
} else {
return Buffer.alloc(0);
}
}
Expand Down
Loading