Skip to content

Fix timeout of connection requests on activation #1577

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

Merged
merged 2 commits into from
Jun 9, 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
12 changes: 1 addition & 11 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ interface ConnectionSettings {
dockerService?: string;
}

// Needed to fix a TS error
declare let AbortSignal: {
prototype: AbortSignal;
new (): AbortSignal;
abort(reason?: any): AbortSignal;
timeout(milliseconds: number): AbortSignal;
};

export class AtelierAPI {
private _config: ConnectionSettings;
private namespace: string;
Expand Down Expand Up @@ -369,7 +361,7 @@ export class AtelierAPI {
} else if (!cookies.length) {
if (!authRequest) {
// Recursion point
authRequest = this.request(0, "HEAD");
authRequest = this.request(0, "HEAD", undefined, undefined, undefined, undefined, options);
authRequestMap.set(target, authRequest);
}
auth = authRequest;
Expand Down Expand Up @@ -408,7 +400,6 @@ export class AtelierAPI {
data: body,
withCredentials: true,
httpsAgent,
timeout: options?.timeout ? options.timeout : 0,
signal: options?.timeout ? AbortSignal.timeout(options.timeout) : undefined,
validateStatus: (status) => status < 504,
});
Expand Down Expand Up @@ -571,7 +562,6 @@ export class AtelierAPI {
return Promise.all([
workspaceState.update(this.configName.toLowerCase() + ":apiVersion", apiVersion),
workspaceState.update(this.configName.toLowerCase() + ":serverVersion", serverVersion),
workspaceState.update(this.configName.toLowerCase() + ":iris", data.version.startsWith("IRIS")),
]).then(() => info);
}
});
Expand Down