super minor issue, but it looks like postlite will simply log an error when it receives an unexpected message type. I saw elsewhere in the code that you already have a pattern for sending errors to the client, so maybe this would be a good candidate for something worth sending errors to the client about? Otherwise, ~I'm pretty sure the connection will get into an inconsistent state where the client is stuck waiting for a response, and~ the end user will likely be very confused.
(edit: I see that the connection will be terminated, which at least helps a bit)
Thanks for the bug report. Yeah, the error handling could be better. I've been overly prudent so far by just killing the connection and logging the error but I'll get that fixed it. 👍
super minor issue, but it looks like
postlite
will simply log an error when it receives an unexpected message type. I saw elsewhere in the code that you already have a pattern for sending errors to the client, so maybe this would be a good candidate for something worth sending errors to the client about? Otherwise, ~I'm pretty sure the connection will get into an inconsistent state where the client is stuck waiting for a response, and~ the end user will likely be very confused.(edit: I see that the connection will be terminated, which at least helps a bit)
https://github.com/benbjohnson/postlite/blob/main/server.go#L239