-
Notifications
You must be signed in to change notification settings - Fork 164
Webhook trigger /sync should receive response from HTTP action #1579
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR modifies the flow response handling for succeeded flows to support custom stop responses. When a flow completes successfully, it now checks for a custom stopResponse object and uses its status, body, and headers if present, otherwise returns a default success message.
Key Changes:
- Added conditional handling for custom stop responses in succeeded flows
- Changed default success response from
NO_CONTENTtoOKwith a message body
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| status: result.stopResponse?.status ?? StatusCodes.OK, | ||
| body: result.stopResponse?.body, | ||
| headers: result.stopResponse?.headers ?? {}, |
Copilot
AI
Nov 5, 2025
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.
The optional chaining on line 323 already checks if stopResponse exists, making the additional optional chaining (?.) on line 325 redundant. Since we're inside the if (result.stopResponse) block, you can safely access result.stopResponse.status directly.
| status: result.stopResponse?.status ?? StatusCodes.OK, | |
| body: result.stopResponse?.body, | |
| headers: result.stopResponse?.headers ?? {}, | |
| status: result.stopResponse.status ?? StatusCodes.OK, | |
| body: result.stopResponse.body, | |
| headers: result.stopResponse.headers ?? {}, |
| status: result.stopResponse?.status ?? StatusCodes.OK, | ||
| body: result.stopResponse?.body, | ||
| headers: result.stopResponse?.headers ?? {}, |
Copilot
AI
Nov 5, 2025
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.
Since we're inside the if (result.stopResponse) block, the optional chaining (?.) is unnecessary. You can access result.stopResponse.body directly.
| status: result.stopResponse?.status ?? StatusCodes.OK, | |
| body: result.stopResponse?.body, | |
| headers: result.stopResponse?.headers ?? {}, | |
| status: result.stopResponse.status ?? StatusCodes.OK, | |
| body: result.stopResponse.body, | |
| headers: result.stopResponse.headers ?? {}, |
| status: result.stopResponse?.status ?? StatusCodes.OK, | ||
| body: result.stopResponse?.body, | ||
| headers: result.stopResponse?.headers ?? {}, |
Copilot
AI
Nov 5, 2025
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.
Since we're inside the if (result.stopResponse) block, the optional chaining (?.) is redundant. You can access result.stopResponse.headers directly.
| status: result.stopResponse?.status ?? StatusCodes.OK, | |
| body: result.stopResponse?.body, | |
| headers: result.stopResponse?.headers ?? {}, | |
| status: result.stopResponse.status ?? StatusCodes.OK, | |
| body: result.stopResponse.body, | |
| headers: result.stopResponse.headers ?? {}, |
|



Part of OPS-2972.