pause: return serviceerror.FailedPrecondition when pausing a Paused activity#10001
Merged
Merged
Conversation
0845a2a to
2f5e463
Compare
fbbb438 to
61e341c
Compare
61e341c to
682bfe3
Compare
5 tasks
fretz12
reviewed
Apr 22, 2026
| } | ||
|
|
||
| if err := validateAndNormalizeTerminateRequest( | ||
| if req.GetRequestId() == "" { |
Contributor
There was a problem hiding this comment.
You might need to pull in main, and we shouldn't make this change. This was moved into the validate function, and we agreed there was no need to clone the proto
| // validateAndNormalizeStartActivityExecutionRequest validates and normalizes the standalone | ||
| // activity specific attributes. Note that this method mutates the input params; the caller must | ||
| // clone the request if necessary (e.g. if it may be retried). | ||
| func (h *frontendHandler) validateAndNormalizeStartActivityExecutionRequest( |
Contributor
There was a problem hiding this comment.
that's strange why this is in the PR, shouldn't be
spkane31
added a commit
that referenced
this pull request
Apr 22, 2026
## What changed? Fixing a bad rebase by (1) adding `validateAndNormalizeStartActivityExecutionRequest` function, (2) correcting the validateXXX functions, and (3) running `make fmt` to format the proto files. ## Why? Fixes bad rebase and unblocks #10001 and #9852 ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks NA
d23aaca to
9507593
Compare
bergundy
approved these changes
Apr 23, 2026
| }) | ||
|
|
||
| t.Run("PauseIdempotent", func(t *testing.T) { | ||
| t.Run("PauseWhilePaused", func(t *testing.T) { |
Member
There was a problem hiding this comment.
Make sure we cover the idempotent case (same request ID)
spkane31
added a commit
that referenced
this pull request
Apr 28, 2026
## What changed? Fixing a bad rebase by (1) adding `validateAndNormalizeStartActivityExecutionRequest` function, (2) correcting the validateXXX functions, and (3) running `make fmt` to format the proto files. ## Why? Fixes bad rebase and unblocks #10001 and #9852 ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks NA
spkane31
added a commit
that referenced
this pull request
Apr 28, 2026
…ctivity (#10001) ## What changed? When calling `PauseActivityExecution` on an already paused activity a `serviceerror.FailedPrecondition` is returned to the user. ## Why? If a user attempts to pause an already paused activity with an identity and reason and then inspects that activity it will show a different identity and reason which is a confusing behavior, returning an error is a better way to show that the request did not alter the activity. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [X] added new functional test(s) ## Potential risks No, this is into a feature branch. After merging the feature branch into main the behavior will change for workflow activities which treat Pause on an already paused activity as a no-op.
spkane31
added a commit
that referenced
this pull request
Apr 29, 2026
## What changed? Fixing a bad rebase by (1) adding `validateAndNormalizeStartActivityExecutionRequest` function, (2) correcting the validateXXX functions, and (3) running `make fmt` to format the proto files. ## Why? Fixes bad rebase and unblocks #10001 and #9852 ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks NA
spkane31
added a commit
that referenced
this pull request
Apr 29, 2026
…ctivity (#10001) ## What changed? When calling `PauseActivityExecution` on an already paused activity a `serviceerror.FailedPrecondition` is returned to the user. ## Why? If a user attempts to pause an already paused activity with an identity and reason and then inspects that activity it will show a different identity and reason which is a confusing behavior, returning an error is a better way to show that the request did not alter the activity. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [X] added new functional test(s) ## Potential risks No, this is into a feature branch. After merging the feature branch into main the behavior will change for workflow activities which treat Pause on an already paused activity as a no-op.
spkane31
added a commit
that referenced
this pull request
Apr 29, 2026
## What changed? Fixing a bad rebase by (1) adding `validateAndNormalizeStartActivityExecutionRequest` function, (2) correcting the validateXXX functions, and (3) running `make fmt` to format the proto files. ## Why? Fixes bad rebase and unblocks #10001 and #9852 ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks NA
spkane31
added a commit
that referenced
this pull request
Apr 29, 2026
…ctivity (#10001) ## What changed? When calling `PauseActivityExecution` on an already paused activity a `serviceerror.FailedPrecondition` is returned to the user. ## Why? If a user attempts to pause an already paused activity with an identity and reason and then inspects that activity it will show a different identity and reason which is a confusing behavior, returning an error is a better way to show that the request did not alter the activity. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [X] added new functional test(s) ## Potential risks No, this is into a feature branch. After merging the feature branch into main the behavior will change for workflow activities which treat Pause on an already paused activity as a no-op.
spkane31
added a commit
that referenced
this pull request
May 11, 2026
## What changed? Fixing a bad rebase by (1) adding `validateAndNormalizeStartActivityExecutionRequest` function, (2) correcting the validateXXX functions, and (3) running `make fmt` to format the proto files. ## Why? Fixes bad rebase and unblocks #10001 and #9852 ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks NA
spkane31
added a commit
that referenced
this pull request
May 11, 2026
…ctivity (#10001) ## What changed? When calling `PauseActivityExecution` on an already paused activity a `serviceerror.FailedPrecondition` is returned to the user. ## Why? If a user attempts to pause an already paused activity with an identity and reason and then inspects that activity it will show a different identity and reason which is a confusing behavior, returning an error is a better way to show that the request did not alter the activity. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [X] added new functional test(s) ## Potential risks No, this is into a feature branch. After merging the feature branch into main the behavior will change for workflow activities which treat Pause on an already paused activity as a no-op.
spkane31
added a commit
that referenced
this pull request
May 12, 2026
## What changed? Fixing a bad rebase by (1) adding `validateAndNormalizeStartActivityExecutionRequest` function, (2) correcting the validateXXX functions, and (3) running `make fmt` to format the proto files. ## Why? Fixes bad rebase and unblocks #10001 and #9852 ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks NA
spkane31
added a commit
that referenced
this pull request
May 12, 2026
…ctivity (#10001) ## What changed? When calling `PauseActivityExecution` on an already paused activity a `serviceerror.FailedPrecondition` is returned to the user. ## Why? If a user attempts to pause an already paused activity with an identity and reason and then inspects that activity it will show a different identity and reason which is a confusing behavior, returning an error is a better way to show that the request did not alter the activity. ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [X] added new functional test(s) ## Potential risks No, this is into a feature branch. After merging the feature branch into main the behavior will change for workflow activities which treat Pause on an already paused activity as a no-op.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
When calling
PauseActivityExecutionon an already paused activity aserviceerror.FailedPreconditionis returned to the user.Why?
If a user attempts to pause an already paused activity with an identity and reason and then inspects that activity it will show a different identity and reason which is a confusing behavior, returning an error is a better way to show that the request did not alter the activity.
How did you test it?
Potential risks
No, this is into a feature branch. After merging the feature branch into main the behavior will change for workflow activities which treat Pause on an already paused activity as a no-op.