atmosphere
atmosphere copied to clipboard
[atmosphere.js] long-polling, two messages in one request, only last one does callback
With long-polling transport, and MessageLengthInterceptor, whenever two messages arrive in a single request, they are split along the delimiter, but the onMessage callback is called only for the last one.
For example, raw message is a string '{"message1" : null}|{"message2" : null}|' Only a single onMessage(respose) is called, with response.responseBody containing '{"message2" : null}';
Same problem. This is more easily reproducible if HeaderBroadcasterCache is added. _invokeCallback is executed with 're-opening' state before 'messageReceived' state. _response.responseBody will be overwritten by last splitted message during 're-opening' state