Skip to content

Conversation

@THardy98
Copy link
Contributor

What was changed

Added support to pause/unpause an activity. Cancellations due to pause are received through the heartbeat mechanism of the activity.

Why?

Part of activity operator work.

  1. Closes Heartbeating activities should be interrupted when the activities are paused. #1665

  2. How was this tested:
    Couple integration tests

  3. Any docs updates needed?
    Likely

@THardy98 THardy98 requested a review from a team as a code owner June 19, 2025 11:47
@THardy98 THardy98 changed the title Activity pause unpause Activity pause/unpause Jun 19, 2025
@THardy98 THardy98 mentioned this pull request Jun 19, 2025
@THardy98 THardy98 mentioned this pull request Jun 19, 2025
*/
export class MockActivityEnvironment extends events.EventEmitter {
public cancel: (reason?: any) => void = () => undefined;
public cancel: (reason?: any, details?: any) => void = () => undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

What would a MockActivityEnvironment user be expected to provide as input for the details argument? The signature says any, and the ActivityCancellationDetails class has a private constructor, so it looks like it is simply impossible for users to provide anything useful here.

One solution would be to have ActivityCancellationDetails be just an interface, rather than a class, but then we'd have to make all properties optional, as adding more fields in the future would be a backward incompatible change.

Can you please look at what we do with this in other SDKs, and try to figure out a proper API for this?

And btw, reason being any also feels wrong.

@mjameswh
Copy link
Contributor

I haven't compared with what we did in other SDKs, but it looks like there was quite a few discussions while you were working on the corresponding Python PR.

Are you sure this PR correctly mirrors the final state of your Python one?

@THardy98
Copy link
Contributor Author

I haven't compared with what we did in other SDKs, but it looks like there was quite a few discussions while you were working on the corresponding Python PR.

Are you sure this PR correctly mirrors the final state of your Python one?

Yes, this mirrors the Python activity pause change

@THardy98 THardy98 requested a review from mjameswh July 23, 2025 19:40
Copy link
Contributor

@mjameswh mjameswh left a comment

Choose a reason for hiding this comment

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

A few moere details before we can merge.

@THardy98 THardy98 requested a review from mjameswh July 31, 2025 20:44
@THardy98 THardy98 force-pushed the activity_pause_unpause branch 2 times, most recently from a66d099 to de50973 Compare August 12, 2025 16:36
@THardy98 THardy98 force-pushed the activity_pause_unpause branch from de50973 to 3ee7227 Compare August 13, 2025 15:14
@THardy98 THardy98 merged commit 544e2b2 into main Aug 18, 2025
24 checks passed
@THardy98 THardy98 deleted the activity_pause_unpause branch August 18, 2025 19:26
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.

Heartbeating activities should be interrupted when the activities are paused.

3 participants