Skip to content

fix(core): honor source abort signal without timeout - #432

Closed
adity982 wants to merge 1 commit into
askable-ui:mainfrom
adity982:fix/context-abort-without-timeout
Closed

adity982 wants to merge 1 commit into
askable-ui:mainfrom
adity982:fix/context-abort-without-timeout

Conversation

@adity982

Copy link
Copy Markdown
Contributor

Summary

  • honor an AbortSignal while resolving a context source even when no timeout is configured
  • share timeout, abort, success, and failure settlement through one cleanup path
  • avoid scheduling a timer when callers provide only a signal, while preventing late source completion from settling twice
  • cover pre-aborted requests, pending cancellation, timer behavior, and listener cleanup on every outcome

Why

runSourceTask() previously returned the source promise directly whenever timeoutMs was omitted. That bypassed the abort listener entirely, so a pending source could keep an aborted request open indefinitely. The timeout and abort paths also did not consistently remove the listener.

Fixes #376.

Validation

  • npm test --workspace @askable-ui/core -- src/__tests__/context.test.ts (131 passed)
  • NODE_OPTIONS=--localstorage-file=... npm test --workspace @askable-ui/core (538 passed)
  • npm run build --workspace @askable-ui/core (includes the @askable-ui/context prebuild)
  • git diff --check

@vercel

vercel Bot commented Sep 15, 2026

Copy link
Copy Markdown

@adity982 is attempting to deploy a commit to the Vam Gan's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vamgan

vamgan commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Closing as already implemented on main in 0ce3fc3. Verified that this entire patch reverse-applies cleanly to current main, including pending abort, no-timeout, and listener-cleanup regressions. The current core suite also passes. No changes are being discarded.

@vamgan vamgan closed this Sep 20, 2026
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.

bug(core): AbortSignal is ignored when source resolution has no timeout

2 participants