Skip to content

feat(ts): durable slot suspension ts cancellation#2953

Draft
grutt wants to merge 5 commits intomainfrom
feat--durable-slot-suspension-ts-cancellation
Draft

feat(ts): durable slot suspension ts cancellation#2953
grutt wants to merge 5 commits intomainfrom
feat--durable-slot-suspension-ts-cancellation

Conversation

@grutt
Copy link
Contributor

@grutt grutt commented Feb 5, 2026

Description

Improves cancellation signaling and propagation for the typescript sdk

Type of change

  • New feature (non-breaking change which adds functionality)

@vercel
Copy link

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment Feb 9, 2026 1:32pm

Request Review

@grutt grutt changed the title Feat durable slot suspension ts cancellation feat(ts): durable slot suspension ts cancellation Feb 5, 2026
@grutt grutt force-pushed the feat--durable-slot-suspension-py-cancellation branch from e9759af to 9a36cc4 Compare February 6, 2026 17:23
@grutt grutt changed the base branch from feat--durable-slot-suspension-py-cancellation to main February 6, 2026 18:30
@grutt grutt force-pushed the feat--durable-slot-suspension-ts-cancellation branch from 030449f to 181a262 Compare February 6, 2026 18:36
return 'cancelling...';
case ActionType.START_GET_GROUP_KEY:
return 'starting to get group key...';
default:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should get into the habit of having that exhaustivenessCheck thing in places like this - just makes it so that we can't forget a case

@@ -0,0 +1,89 @@
export function createAbortError(message = 'Operation aborted'): Error {
const err: any = new Error(message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need the type hint for any here?

}

export function isAbortError(err: unknown): err is Error {
return err instanceof Error && (err.name === 'AbortError' || (err as any).code === 'ABORT_ERR');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should factor our AbortError and ABORT_ERR into constants if we're sharing them?

// `signal` must never be sent over the wire.
const optsWithoutSignal: Omit<ChildRunOpts, 'signal'> & { signal?: never } = { ...opts };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
delete (optsWithoutSignal as any).signal;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to do this without the assertion to any?

Copy link
Contributor

@mrkaye97 mrkaye97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a couple small comments, but broadly looks good to me 👍

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.

2 participants