-
Notifications
You must be signed in to change notification settings - Fork 60
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
[Bug] Fix 500 error in /hivechat/response endpoint - Primary key conflict in message creation #2210
Comments
@MahtabBukhari as discussed |
@humansinstitute assign |
@MahtabBukhari -> Testing this morning, this isn't correctly processing the Chat ID as far as I can tell from Stakwork. If we consider this screenshot of the look test, we can see that the chatId is returned as part of the 200 response. The messages aren't shown in the interface or returned from a Get Messages by Chat ID call (see network tab). So my guess is that when these are processed we're not correctly setting the messages with the chat ID. Otherwise they would be returned on a page refresh (even if the websocket failed). Then when we check the stakwork output we see that we got a 200 message resposne, but that it doesn't include the chatId in the response.
Response:
|
@humansinstitute let me check that one too |
Perhaps should be: Given the return object? |
issue is something else but let me check |
Test Data
Other potential
|
Context
The
/hivechat/response
endpoint is currently returning 500 errors when processing responses from Stakwork. Investigation shows this is due to incorrect message ID handling in the response processing logic.Current Behavior
Required Changes
ProcessChatResponse
handler inhandlers/chat.go
:xid.New().String()
messageId
in the request structure for reference onlyTesting
Related Code
handlers/chat.go
/hivechat/response
ChatMessage
structAdditional Context
The messageId from Stakwork's response should be treated as a reference to the original message being responded to, not as the ID for the new message.
The text was updated successfully, but these errors were encountered: