Skip to content

feat: AbortSignal cancellation for RPC, wired to async-render supersede #492

Description

@vivek7405

Sub-issue of #488. webjs's RPC stub has no cancellation: a superseded async render() refetch keeps its network request in flight, and there is no way to abort an action call. TanStack Start passes a signal: AbortSignal to the server fn and the client can abort.

Design / approach

Pass an AbortSignal to the action (the server handler aborts when the client disconnects) and expose cancellation to the client stub. Crucially, wire it to webjs's existing async-render supersede token (__renderToken in component.js): when a prop change supersedes an in-flight async render(), abort the previous render's RPC instead of letting it complete and get dropped. Compose with streaming RPC (a cancelled stream stops on both ends). Keep it opt-in / automatic where safe (a superseded render auto-aborts).

Acceptance criteria

  • The action receives an AbortSignal; aborting it (client disconnect or explicit) stops server work where possible.
  • A superseded async render() refetch aborts its in-flight RPC (network probe shows the request cancelled).
  • Composes with streaming RPC (a cancelled stream stops on both ends).
  • Tests: unit + browser/e2e (cancel-on-supersede network probe).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions