-
-
Notifications
You must be signed in to change notification settings - Fork 753
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
Socketio context information when payload too large #3096
Comments
Is this an event that happens on the socket or an error response from the service? Does the Socket.io client itself return more information than that? |
Well, this happens when you send a payload that exceeds the limit. The server than reacts with disconnecting the socket. That is ok, but it's nice if it would pass to the client the reason why it disconnected. Apparently in socketio/socket.io-client#1518 they solved it, but the feathers socket does not pass that property to the client as well... or so it seems ) // app.ts on server
app.configure(
socketio({
maxHttpBufferSize: 123, // something stupidly low
cors: {
origin: app.get('origins')
}
})
) // in client:
socket.on('disconnect', (reason, details) => {
console.log(reason) // "transport error"
// in that case, details is an error object
// console.log(details.message); "xhr post error" // >>>>>> missing param
console.log(details) // 413 (the HTTP status of the response)
}) And then patch some kind of field with a string longer than 123 characters ;) |
That's why I was asking because the |
Closing since I don't think Feathers is changing anything in that message and it is what Socket.io itself does. |
As per socketio/socket.io-client#1518 since socket v4.5.0 there is additional information about why the socket closed; for example when the payload exceeds a certain
maxHttpBufferSize
threshold. We are uploading 'data:' URI images by socket, so that can happen.In feathers the socket response does not yet contain the message why we lost socket connection. :
The text was updated successfully, but these errors were encountered: