-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API: posting new conversation: await message created (#2239)
This PR ensures a conversation is not created if we cannot create its first message, and allows error handling before creating the conversation Namely, when creating a new conversation with a message, the message creation event (or error) is awaited. This is fast because we do not wait for the full message posting (with all redis events, etc.), only the creation event. In doing so, it aligns the behaviour of `front/pages/api/w/[wId]/assistant/conversations/index.ts` with the ones of `front/pages/api/v1/w/[wId]/assistant/conversations/index.ts`, `front/pages/api/w/[wId]/assistant/conversations/[cId]/messages/index.ts` and `front/pages/api/v1/w/[wId]/assistant/conversations/[cId]/messages/index.ts`, who were already awaiting Required for [this task](dust-tt/tasks#128) (plan limits -- do not create the conversation if the message cannot be created because the message limit has been reached)
- Loading branch information
1 parent
81c1b7c
commit a0426f9
Showing
3 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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