-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(stepfunctions): the Retry field in the statesJson in CustomState is always overwrited #28793
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,10 +68,17 @@ export class CustomState extends State implements IChainable, INextable { | |
* Returns the Amazon States Language object for this state | ||
*/ | ||
public toStateJson(): object { | ||
return { | ||
const state = { | ||
...this.renderNextEnd(), | ||
...this.stateJson, | ||
...this.renderRetryCatch(), | ||
}; | ||
|
||
// merge the Retry filed defined in the stateJson into the state | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Retry is configured in two ways(the |
||
if (Array.isArray(this.stateJson.Retry)) { | ||
state.Retry = [...state.Retry, ...this.stateJson.Retry]; | ||
} | ||
|
||
return state; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not to do the same for the Catch field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moelasmar
Thanks for clarifying.
As mentioned in the comments (#25798 (comment)), the method of defining the
Catch
directly in JSON for theCustomState
did not render well and forced us to call_addCatch
in the baseState
class.The
addCatch
method was added to solve this in this PR (#28422), but now it overrides theCatch
andRetry
fields in the JSON.So it will take some investigation and changes to be able to define the
Catch
directly in JSON.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sakurai-ryo for the clarifying.