AdaHeads / call-flow-control

Call-information flow server.
Other
6 stars 8 forks source link

Some interfaces returns a 200 OK with pointless content. #71

Closed PedersenThomas closed 10 years ago

PedersenThomas commented 11 years ago

Change these to return a 204 no content. If we only need to inform the user whether we succeeded or not, then we should use 204 no content instead of 200 OK with some redundant Json string.

rostgaard commented 11 years ago

Which interfaces? Shouldn't 204 no content only be for responses with no content? Shaving of a few bytes off the protocol, on the cost of making it less transparent is no a good tradeoff IMHO.

If this turns out to be a problem, we can revisit this issue at a later time.

ThomasLocke commented 11 years ago

I think you're missing the point Kim: We've got some interfaces that return 200 OK, and then deliver content that says one thing: 200 OK. In those cases we should return a 204 with no content, since there is no actual content. In short: The content these interfaces deliver now are completely and utterly pointless. So yes, 204 is for responses with no content, and these interfaces are just that. We just happen to dump some json in there for no good reason.

No transparency is lost.

rostgaard commented 11 years ago

I've understood the point fine. But this is optimizing an incomplete protocol - which is even more pointless. Even so, is this really a high-priority issue? I agree whole-heartedly that we shouldn't have redundant data in our protocol, but at this point in the development, our priorities should be focused elsewhere. Saving 10 bytes worth of data is premature optimization.

ThomasLocke commented 11 years ago

As far as I can see this issue has not been assigned any milestone, so it is by far not a high-priority issue, nevertheless it is an issue that is in Alice right now, and instead of forgetting it, we put it here and assigned it to me, as I'm likely going to be the one who finalizes the handlers in Alice, and hence need to remember to pay attention to this.

rostgaard commented 10 years ago

The protocol settled on using 200 and empty objects for no content as this makes the client code cleaner. Most interfaces return a, probably redundant, status in the body of the request along with an optional description.