Due to an oversight in my original JSON serialization techniques, I was sending events over the websocket with their type values incorrectly serialized as integer values instead of string values (e.g. {"type": 0, "token": "..."} instead of {"type": "Authenticate", "token": "..."}. I expected the server to return an Error event indicating that an invalid event was recieved or that authentication was not complete/failed, but instead I never received anything at all.
If this is just the current behavior and not necessarily intended, I believe the websocket should return an Error model indicating the problem, perhaps adding a new error value? Alternatively, Bonfire could simply send an Unauthorized error value for any sent events while not currently authenticated. Whatever works, works, but I think the current behavior is not ideal.
What happened?
Due to an oversight in my original JSON serialization techniques, I was sending events over the websocket with their
type
values incorrectly serialized as integer values instead of string values (e.g.{"type": 0, "token": "..."}
instead of{"type": "Authenticate", "token": "..."}
. I expected the server to return anError
event indicating that an invalid event was recieved or that authentication was not complete/failed, but instead I never received anything at all.If this is just the current behavior and not necessarily intended, I believe the websocket should return an Error model indicating the problem, perhaps adding a new
error
value? Alternatively, Bonfire could simply send anUnauthorized
error value for any sent events while not currently authenticated. Whatever works, works, but I think the current behavior is not ideal.