-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
api:httparea:apigood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededmodel:languagesize:smalltype:bugSomething isn't working as expectedSomething isn't working as expected
Description
A Glide's streaming channel gets closed on chat requests that doesn't pass validation.
The issue is in the way we handle errors right now:
glide/pkg/api/http/handlers.go
Lines 139 to 148 in bca8c8f
if err = c.ReadJSON(&chatRequest); err != nil { | |
// TODO: handle bad request schemas gracefully and return back validation errors | |
if websocket.IsUnexpectedCloseError(err, websocket.CloseNormalClosure, websocket.CloseGoingAway) { | |
tel.L().Warn("Streaming Chat connection is closed", zap.Error(err), zap.String("routerID", routerID)) | |
} | |
tel.L().Debug("Streaming chat connection is closed by client", zap.Error(err), zap.String("routerID", routerID)) | |
break | |
} |
For example, you can open a streaming chat connection (via Postman, for example):
{{base_url}}/language/{{routerID}}/chatStream
Then, send it just an empty message like:
{
}
Finally, if you try to send a valid message now:
"message": {
"role": "user",
"content": "Write an essay about ecommerce in a modern era"
}
It would not really work.
Metadata
Metadata
Assignees
Labels
api:httparea:apigood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededmodel:languagesize:smalltype:bugSomething isn't working as expectedSomething isn't working as expected