PDA

View Full Version : [CLOSED-1000] ScriptTagProxy broken for multiple requests



mankz
27 May 2010, 1:07 AM
Seems ScriptTagProxy should have a config setting autoAbort : false as default. There is a check in its doRequest implementation as seen below. Result is that the last call wins and the rest are cancelled when performing multiple simultaneous requests.



doRequest : function(action, rs, params, reader, callback, scope, arg) {
var p = Ext.urlEncode(Ext.apply(params, this.extraParams));

var url = this.buildUrl(action, rs);
if (!url) {
throw new Ext.data.Api.Error('invalid-url', url);
}
url = Ext.urlAppend(url, p);

if(this.nocache){
url = Ext.urlAppend(url, '_dc=' + (new Date().getTime()));
}
var transId = ++Ext.data.ScriptTagProxy.TRANS_ID;
var trans = {
id : transId,
action: action,
cb : "stcCallback"+transId,
scriptId : "stcScript"+transId,
params : params,
arg : arg,
url : url,
callback : callback,
scope : scope,
reader : reader
};
window[trans.cb] = this.createCallback(action, rs, trans);
url += String.format("&{0}={1}", this.callbackParam, trans.cb);
if(this.autoAbort !== false){ // Here this.autoAbort is undefined
this.abort();
}

evant
14 Jul 2010, 5:26 AM
This behaviour has already been fixed for 4.x, however 3.x would need some more refactoring to make this work correctly, so I think we'll close off this issue and defer the fix until 4.0.

Thanks for the report.