Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

messageLength of next message is glued after current one in IE #597

Closed
janbols opened this issue Sep 6, 2012 · 3 comments
Closed

messageLength of next message is glued after current one in IE #597

janbols opened this issue Sep 6, 2012 · 3 comments

Comments

@janbols
Copy link

janbols commented Sep 6, 2012

I'm using ...

  • atmosphere 1.0.0,
  • IE9 and
  • transport=streaming.

I have an atmosphereHandler with a TrackMessageSizeInterceptor, AtmosphereResourceLifecycleInterceptor and BroadcastOnPostAtmosphereInterceptor.

On IE, the onMessage callback receives messages where the length of the next message is concatenated with the current one.

Also, the first message is not the payload, but the messageLength.
F.e. the following resonsebody ...
2113|<!-- ---------------------------------------------------------------- http://github.com/Atmosphere
...

102|{"availability":"OFFLINE","timestamp":"2012-09-05T17:36:42.256","messageType":"ownAvailabilityUpdate"}

... is turned into 2 onMessage callbacks:
1: 102
2: {"availability":"OFFLINE","timestamp":"2012-09-05T17:36:42.256","messageType":"ownAvailabilityUpdate"}

When multiple messages arrive, the payload is split incorrect.
F.e. the following responsebody ...
2113|<!-- ---------------------------------------------------------------- http://github.com/Atmosphere
...

444|{....first message ...}99|{... second message ...}99|{ ... third message ...}

... is turned into the following onMessage callbacks:
1: 444
2: {....first message ...}99
3: {... second message ...}
4: 99
5: { ... third message ...}

Notice how the 2nd & 3rd message (which are much smaller) are split correctly.

I don't have the same issues in chrome or firefox.

@janbols
Copy link
Author

janbols commented Sep 6, 2012

When I add the MessageLengthInterceptor to the mix, an extra | is placed between the current message and the next messagelength. In this case, the parsing is better, but the messageLength is still passed to the onMessage callback as an incoming message. So in the above example, the following messages would be passed in the onMessage callback:
1: 444
2: {....first message ...}
3: 99
4: {... second message ...}
5: 99
6: { ... third message ...}

@jfarcand
Copy link
Member

Fixed, download it from here and let me know

@janbols
Copy link
Author

janbols commented Sep 11, 2012

Fixed indeed ;-)

jfarcand added a commit that referenced this issue Sep 18, 2012
jfarcand added a commit that referenced this issue Sep 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants