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

Json data that I pass using atmosphere sometimes is corrupted #200

Closed
xserge opened this issue Feb 29, 2012 · 7 comments
Closed

Json data that I pass using atmosphere sometimes is corrupted #200

xserge opened this issue Feb 29, 2012 · 7 comments

Comments

@xserge
Copy link

xserge commented Feb 29, 2012

Hello, I found error on runtime.

My configuration:
Atmosphere 0.8.5,
Firefox 10.0.2
glassfish-3.1.2-web-b23

In my application I send json data from serverside to browser.
I noticed that sometimes I can't parse json data on a client because data is periodically corrupted.
The problem appears in two variants:

  1. sometimes data that passed in atmosphere callback concatenates two json results. Just after one set of json data
    goes next set of json data in one parameter of atmosphere callback. And $.parseJSON() parses this data with error.
    During debugging I found that in that case something wrong with variable request.lastIndex on atmosphere javascript sources
    response.responseBody = responseText.substring(request.lastIndex, responseText.length);
  2. sometimes data that passed in atmosphere callback is cutted somethere in middle.
    During debugging of atmosphere javascript sources I found that corrupted data received on that line
    line:330 var responseText = ajaxRequest.responseText;
    So XMLHttpRequest object returns cutted data. (but may be it is sideeffect of debugging)
@jfarcand
Copy link
Member

jfarcand commented Mar 1, 2012

Salut, never faced such issues :-( Do you have a fix for that?

@jfarcand
Copy link
Member

jfarcand commented Mar 1, 2012

Also can you try 0.9-SNAPSHOT to see if that help?

Thanks!

@vasim
Copy link

vasim commented Mar 6, 2012

I have the same issue.
Seems the problem is well known see:
#70

I can reproduce the problem using the sample atmosphere-meteor-pubsub-period attached to this thread:
http://groups.google.com/group/atmosphere-framework/browse_thread/thread/4016338ae729bd39/1657bda49e6b6368?lnk=gst&q=#1657bda49e6b6368

It is very important for me to get a fix for the version 0.8.6 or some patch in this version.

Thanks,
Vasile

@jfarcand
Copy link
Member

This is not a bug, but a missing features in Atmosphere. Take a look at the Twitter Feeds for a workaround

 https://github.com/Atmosphere/atmosphere/blob/master/samples/twitter-live-feed/src/main/webapp/index.html#L42

@vasim
Copy link

vasim commented Apr 17, 2012

I would like to reopen this issue.
I consider it as an issue, if you want to name it feature, it is fine but please implement this in the Atmosphere.
Maybe as an option, depending on the application you need this feature or maybe you can ignore it.
But at least I want to be able to activate this feature in Atmosphere itself.

@jfarcand
Copy link
Member

This has been fixed in 0.9. Take a look at the Twitter-live-feed sample.

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

3 participants