Skip to content

Implement AbortSignal composition for Code OSS requests #766

Description

@wieslawsoltes

Merged implementation checkpoint — 20 September 2026

Exact heads: WebScene main 6b0e3e3ee1a6ab32236a47d6670be85c6a73c0d1, AppScene main 773e94e26b58eac423ca24d5e47bea172965c94c, unchanged Code OSS 645f29cc3176500b4b5762ba887cf2a7f0ffdf2c, local vscode-demo 93336a1e9e939c29e0eda73aa5d673f5322d5ebf (clean, 304 commits ahead, intentionally unpushed), WebScene consolidation #76 26927943dedaa4ae66b7edf580d307d1c4edcace, and AppScene consolidation #65 0702d52e37d0a1aeeac6956092c5b241a9c05beb. Repository Actions remain disabled.

PR #767 merged at WebScene main 6b0e3e3ee1a6ab32236a47d6670be85c6a73c0d1. Implementation commit d5b7670e5e8522220cc2bdaab7487986726c5c4a supplies branded main/iframe AbortSignal and AbortController, static abort, timeout, and any, first-reason ordering, bounded fan-in/composition/timer ownership, dependent-listener cleanup, and frame/navigation/shutdown retirement. Ledger commit 219aa5071ccdbff498d80aad843bd81dd0991198 records the exact scope.

Browser/native contracts were authored but not executed under the active implementation-throughput directive. Installed Code OSS request/fetch cancellation remains blocked in #263, with worker and webview consumers tracked by #81 and #264.

Parent: #263. Worker/webview consumers: #81 and #264.

Proven gap

Current WebScene exposes AbortController but deliberately records static AbortSignal composition helpers and full interface branding as unimplemented. In the main realm AbortSignal is not installed as a usable constructor, while iframe realms use a separate JavaScript-only shape.

Unchanged Code OSS 1.137 directly calls AbortSignal.any(...) and AbortSignal.timeout(...) in the shared browser request implementation. The same forms are used by GitHub request scheduling and cancellation paths. Missing helpers can fail before fetch begins and prevent cancellation/timeout retirement.

Focused implementation

  • expose one browser-shaped AbortSignal/AbortController surface in main and iframe realms;
  • add AbortSignal.abort(reason), AbortSignal.timeout(milliseconds), and AbortSignal.any(iterable);
  • preserve first-reason ordering, already-aborted input behavior, asynchronous timeout dispatch, throwIfAborted, onabort, EventTarget delivery, and listener-option cleanup;
  • validate types and Web IDL numeric conversion with browser-compatible error classes;
  • cap composition fan-in and reuse the bounded runtime timer/task queues;
  • remove dependent listeners after settlement and retire timer/composition state on frame teardown, navigation, and runtime shutdown;
  • keep Code OSS unchanged and add no Electron/Chromium/CEF/WebView dependency.

Deferred gates

Author browser/native contracts for shape, branding, default and custom reasons, iterable errors, first-reason order, zero/finite timeout ordering, nested frame behavior, fetch cancellation, listener cleanup, navigation/shutdown retirement, bounded fan-in, allocation, memory, and idle publication. Execution remains deferred under the active implementation-throughput directive.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    vscode-oss/plannedPlanned for the AppScene/WebScene VS Code OSS integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions