Page 1 of 1

JSON response incomplete

Posted: Mon Nov 18, 2013 2:00 pm
by Adam Garbinski

Hi,

I use this code upon succesful query service execution to pass JSON response to local storage:

var JSONresponse = JSON.stringify(data);
localStorage.setItem("_Arttable_json_response", JSONresponse);

It worked fine so far, but today I am getting incomplete data after query execution. When I look inside my variable '_Arttable_json_response' at console local storage resources, I can see the data string ending like this:

-11-15 19:50:58.566"},{"_id":"52867b22e4

so it is definitely incorrect, and I can see the large part of response is missing.
No errors thrown on the console, however when I do:

console.log(JSONResponse) then I can see the whole dataset returned.

Browser cache flushed.

Do you have any ideas what might cause this problem? I haven't modified my data in database.


JSON response incomplete

Posted: Mon Nov 18, 2013 2:55 pm
by Maryna Brodina

Hello! Could you clarify what browser you use to test? Is localStorage overfilled? Please try to clear it using prelocalStorage.clear()/pre and test app again.


JSON response incomplete

Posted: Mon Nov 18, 2013 3:12 pm
by Adam Garbinski

I use Chrome. No, it is not overfilled, flushed its cache and used localStorage.clear()
Please look here:

Image

Still, after executing my query I get incomplete data saved in local storage.


JSON response incomplete

Posted: Mon Nov 18, 2013 3:16 pm
by Maryna Brodina

Please give us your public app link and tell how to reproduce the problem.


JSON response incomplete

Posted: Mon Nov 18, 2013 3:29 pm
by Adam Garbinski

The app is here:

http://appery.io/app/mobile-frame?src...

On the start screen simply press 'Get data' button. It will start service and load the results into this local variable:

_Arttable_json_response


JSON response incomplete

Posted: Mon Nov 18, 2013 4:49 pm
by Kateryna Grynko

Hi Adam,

The cut line in console is just a developer console feature. Please try running the following code in console:preJSON.parse(localStorage.getItem("_Arttable_json_response"))/preYou'll see something like:preArray[863]/pre


JSON response incomplete

Posted: Mon Nov 18, 2013 7:14 pm
by Adam Garbinski

Katya,
You are perfectly right. I was testing something else and it turned out that the problem lied somewhere else, by coincidence only pointing to this local storage.
Thanks for checking and sorry for troubling.
Cheers,
Adam