fix(server): support desktop PTY websockets with HttpApi (#25598)

This commit is contained in:
Kit Langton
2026-05-03 14:23:29 -04:00
committed by GitHub
parent adb7cb1037
commit 387220f368
17 changed files with 564 additions and 436 deletions

View File

@@ -1,4 +1,4 @@
export function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {
export function withTimeout<T>(promise: Promise<T>, ms: number, label?: string): Promise<T> {
let timeout: NodeJS.Timeout
return Promise.race([
promise.finally(() => {
@@ -6,7 +6,7 @@ export function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {
}),
new Promise<never>((_, reject) => {
timeout = setTimeout(() => {
reject(new Error(`Operation timed out after ${ms}ms`))
reject(new Error(label ?? `Operation timed out after ${ms}ms`))
}, ms)
}),
])