atmosphere icon indicating copy to clipboard operation
atmosphere copied to clipboard

[atmosphere.js] long-polling, two messages in one request, only last one does callback

Open nite23 opened this issue 14 years ago • 1 comments

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}';

nite23 avatar Aug 20 '12 20:08 nite23

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

xenster86 avatar Aug 21 '12 06:08 xenster86