-
Notifications
You must be signed in to change notification settings - Fork 317
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
feat(bot): add support for Prefer: respond-async
on Bot/$execute
#4461
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
89345ef
to
94d3701
Compare
@@ -76,11 +83,51 @@ export interface BotExecutionResult { | |||
* Assumes that input content-type is output content-type. | |||
*/ | |||
export const executeHandler = asyncWrap(async (req: Request, res: Response) => { | |||
if (req.header('Prefer') === 'respond-async') { | |||
await sendAsyncResponse(req, res, async () => { | |||
return new Promise<Parameters>((resolve, reject) => { |
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.
Any reason not to make this async
?
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.
I believe this was the only way to make the outer promise resolve after the execution of the inner callback... could be a way to refactor it to an async function but it's not obvious to me at the moment
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.
Actually I was wrong there was a pretty clear refactor making executeOperation
return what was getting passed through the callback and turning everything async
0f98f14
to
330d207
Compare
|
Add projectId to batch metrics (#4454)Removing duplicate content fixes #4390 (#4431) feat(agent): support `Prefer: respond-async` for `Agent/$push` (#4455) Update default project access policy for new systemSetting (#4466) Fixes #4463 - remove version history circuit breaker (#4467) [Provider app] Add patient communications tab (#4465) feat(bot): add support for `Prefer: respond-async` on `Bot/$execute` (#4461) Split minor and major version upgrades (#4475) Dependency upgrades 2024-04-29 (#4472) Add Extension to Bot resource (#4474) Fix tar.x import (#4477)
Add projectId to batch metrics (#4454)Removing duplicate content fixes #4390 (#4431) feat(agent): support `Prefer: respond-async` for `Agent/$push` (#4455) Update default project access policy for new systemSetting (#4466) Fixes #4463 - remove version history circuit breaker (#4467) [Provider app] Add patient communications tab (#4465) feat(bot): add support for `Prefer: respond-async` on `Bot/$execute` (#4461) Split minor and major version upgrades (#4475) Dependency upgrades 2024-04-29 (#4472) Add Extension to Bot resource (#4474) Fix tar.x import (#4477)
Add projectId to batch metrics (#4454)Removing duplicate content fixes #4390 (#4431) feat(agent): support `Prefer: respond-async` for `Agent/$push` (#4455) Update default project access policy for new systemSetting (#4466) Fixes #4463 - remove version history circuit breaker (#4467) [Provider app] Add patient communications tab (#4465) feat(bot): add support for `Prefer: respond-async` on `Bot/$execute` (#4461) Split minor and major version upgrades (#4475) Dependency upgrades 2024-04-29 (#4472) Add Extension to Bot resource (#4474) Fix tar.x import (#4477)
Depends on #4455
Closes #4458