PDA

View Full Version : Strange ajax caching of string array stale data



geniodella
9 Jul 2012, 1:58 PM
Hi,
i am making an example with an ajax request saving the checked data of a grid tree,
using two arrays one for checked values and one for unchecked values
what happens is that sometimes i have one of the two arrays empty
and i see them empty in firebug even in the success method of the request,
but on the serverside i don't receive an empty array but stale data,
i even tried to close the browser and make a brand new selection
on the checkTree but yet it retains old data.

scottmartin
9 Jul 2012, 2:14 PM
Can you clarify when traffic is getting clobbered ...

ex:
Client request (payload) ->
server data (stale? as sent?) ->
Client Response;success->xhr.response ( stale from server, empty?)

Scott.

geniodella
9 Jul 2012, 2:24 PM
ok in the success function of the ajax request i
do this : var obj = Ext.decode(response.responseText);
console.dir(obj);

and here i see that even if i didn't select for example any node
the selected array is populated with old selections.

always in the success function i print the value of the selection array
console.log(selection)

and here i have the consistent result, an empty array.

on the server i receive the stale data too.

To be precise if the arrays get populated the stale data is overwritten by new one
the problem arise when i expect to receive an empty array

geniodella
9 Jul 2012, 4:43 PM
Ok for a strange reason which could be interesting to understand,
if i encode the arrays in the ajax request and decode them back
on the server the result looks consistent, no stale data!

scottmartin
9 Jul 2012, 5:39 PM
This is correct ;)

Scott.

geniodella
10 Jul 2012, 12:36 AM
What do you mean by correct Scott?
I didn't understand the meaning of this behaviour.............. :-?