Skip to content

fix: support AbortSignal timeout with TypeScript 4.9 - #617

Open
PointerL wants to merge 1 commit into
oss-compass:mainfrom
PointerL:fix/577-abort-signal-timeout
Open

PointerL wants to merge 1 commit into
oss-compass:mainfrom
PointerL:fix/577-abort-signal-timeout

Conversation

@PointerL

Copy link
Copy Markdown

Summary

  • add a local optional type for the runtime-supported AbortSignal.timeout API
  • preserve the existing 180-second timeout when supported
  • preserve the no-timeout fallback for older browsers

Root cause

The runtime feature check was safe, but the repository uses TypeScript 4.9.5, whose DOM declarations do not include the static AbortSignal.timeout method. As a result, both the feature check and method call produced TS2339 diagnostics.

The fix keeps the type adaptation local to openContainerChannel, avoiding a global declaration or TypeScript/lib upgrade.

Validation

Passed:

  • node --max-old-space-size=8192 node_modules/typescript/bin/tsc --noEmit --lib DOM,ES2020 --target ES2020 --module ESNext --strict --skipLibCheck apps/web/src/modules/intelligent-analysis/UserJourney/rawData/apiClient.ts
  • node node_modules/lint-staged/bin/lint-staged.js
  • git diff --check
  • Next.js type checking and production compilation completed successfully with an 8 GB Node heap

Full-repository checks also found unrelated baseline/environment issues:

  • yarn test:ci: 140/141 tests passed; the only failure is the existing POSIX-path assertion in pathSafety.test.ts when run on Windows
  • full tsc --noEmit: the two docs(issue): apps/web 的 tsc --noEmit 目前不通过,AbortSignal.timeout 缺少类型 #577 TS2339 diagnostics are gone; seven unrelated diagnostics remain in translation typing, EvaluationMerticList, _app.tsx, and tsconfig.json
  • next build: compilation succeeded, but Windows final build tracing hit the OS EMFILE file-handle limit

No runtime unit test was added because the runtime branches are unchanged; the regression is the TypeScript declaration compatibility itself.

AI assistance

Codex was used to inspect the issue and repository guidance, implement the local type adaptation, run validation, and draft this description. The contributor reviewed the diff and validation results.

Fixes #577

Signed-off-by: PointerL <lixuexin130@163.com>
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@PointerL is attempting to deploy a commit to the codersett's projects Team on Vercel.

A member of the Team first needs to authorize it.

@PointerL

Copy link
Copy Markdown
Author

Hi @coder-sett, a gentle reminder that the GitHub Actions run for this PR is still awaiting maintainer approval (action_required). This is a focused fix for #577 touching one file (+5/-2), and DCO has passed.

This contribution is intended for the 2026 直通乌镇 open-source competition, whose OSS Compass submission window requires the contribution to be merged before 2026-10-25 00:00. I would appreciate a workflow approval or review when convenient. Thank you!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(issue): apps/web 的 tsc --noEmit 目前不通过,AbortSignal.timeout 缺少类型

1 participant