Under heavy server load, my autocompleter was doing something strange. The
ajax requests were coming back out of order. For example in a contact name
search if I typed: dan

I would get responses like so:
Result set for: d
Result set for: dan
Result set for: da

So once the typing stopped I would be looking at the "da" query results not
the "dan" results.

I modified the control.js file near line 328 with:

if((typeof(data_1) == "object") && data_1.transport.readyState != 4)
   data_1.transport.abort();

data_1 = new Ajax.Request(this.url,this.options);

This kills a pending request if you start another one before it completed.
It fixed my problem. Can anyone see any problems with this? Another set of
eyes would be much appreciated!

Thanks,
Daniel Elmore


_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to