Error occurs when changing username entry during AJAX Request


I encountered this issue while I was trying to enter UserName very quickly. The AJAX request is initiated and I was trying to continue editing the UserName which cases another AJAX request to be imitated while the 1st one is not completed yet. Or at least this is what I guess.
ValidateOnKeyPress is set to True
KeyPressDelay is set to 200. However when I increased this value to 1000 the delay between key press prevent this issue to take place. But I was able to reproduce it when I made the execution of the service to take much longer so that the delay has no effect at this case as the new AJAX request is initiated before the previous one completes.
Closed Sep 28, 2008 at 8:47 PM by Encosia
Appears to be resolved. Re-open if anyone is able to reproduce on the latest version.


JRumerman wrote Sep 22, 2008 at 6:37 AM

Shouldn't the webrequest.abort code that's in the _doValidate method handle this situation? The second _doValidate fires, the response of the first _doValidate hasn't been received so the code aborts the first webrequest (which is probably just marking it to ignore the response), and then the second one begins to execute.

Is anybody 100% that the abort method does what we think it does (and works properly) and the onsuccess or onfailure methods attached to its response, won't execute when the response is received?

Just to make sure I've got the problem right, it sounds like you're describing an issue where the web service takes longer to respond than the time it takes to initiate another request. Is that correct? If so, I think an easy way to test for this problem is to put a sleep in the web service so it takes a while to respond. The first response should then be ignored.

wrote Sep 22, 2008 at 7:07 PM

Encosia wrote Sep 23, 2008 at 1:03 AM

jnagy's improvements in #40438 seem to fix this. I'm unable to reproduce.

However, the requests do not appear to be aborting on the client side. If there are still problems, we might need to investigate calling the service through the XmlHttpExecutor class instead of WebServiceProxy. I believe it has better abort support.

So, is anyone able to reproduce the error, using #40438?

mosessaur wrote Sep 24, 2008 at 4:43 PM

I tested this after downloading latest source. It works fine no Error (alert) message displayed. I set a delay on the Web Service Method as well using Sleep method. Many Ajax Requests are initiated when the KeyPressDelay and MinimumLength is too small, but no exceptions or errors occur.
I recommend to make the Minimum value for KeyPressDelay 500 ms.

wrote Sep 28, 2008 at 8:47 PM

wrote Feb 14, 2013 at 12:13 AM

wrote May 16, 2013 at 5:31 AM