-
Notifications
You must be signed in to change notification settings - Fork 11
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
828 steamline win level info message #873
Conversation
…ferent one for level 3
…r has won the level
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.
Minor suggestions only, and one to chew on.
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.
Lovely!
I need to solve a problem where we are not sending the congratulations message if there is an OpenAI error after the winning email has been sent |
I've decided the gain is not worth the cost. In the startlingly unlikely event that the user would win a level with a sent email, but open has an error after the function call, then the user will not win the level. |
Description
Before, when the user would send a message that would cause the level to be won, we would check if
wonLevel
in the backend's response wastrue
, and if so, we would add a congratulations message to the chat History, causing an extra API call.Now, we return the congratulations messagge (
wonLevelMessage
) in the chat response. The front end simply appends it to the history if it is there, and can use this to determine if the user has won the level.Screenshot
Notes
also does these things:
chatMessageType
LEVEL_INFO
toLEVEL_COMPLETE
Concerns
ChatHttpResponse
contains thewonLevel
boolean property. It gets marked as true at the points of the send email function call. At the end ofhandleChatToGPT
in the chatController, we checkwonLevel
. If we have won the level, then we add the congratulations message to the history and return it to the frontend. The frontend only needs the congratualtions message to determine that a level has been won, making wonLevel redundant in the frontend. This is untidy, but not necessarily problematic. This will be made irrelevant by Refactor: Shift the logic for checking win condition #780Checklist
Have you done the following?