https://bugzilla.wikimedia.org/show_bug.cgi?id=59604

Krinkle <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #13 from Krinkle <[email protected]> ---
That patch, as far as I can see, did nothing. And if it did, it would actually
have caused a regression.

The TypeError thrown is caused by the JSONP <script> tag request finishing and
trying to invoke a temporary global function that jQuery exposed, but has
revoked since because the consumer of $.ajax, VisualEditor in this case, has
aborted the request.

All jqXHR objects have an abort method. Duck-typing it is useless because it is
always there.

And while JSON-P doesn't have a native abort mechanism, jQuery does a good job
of emulating it (it will do a best effort approach to cancel the http request
for efficiency reasons, and in case it still makes it, it will make sure it
reaches a dead end and not cause our application code to process its data[1]).

As I mentioned before, the dead end results in a Uncaught TypeError which
sounds bad, but isn't, because it's in an asynchronous and independent call
stack that has no influence on either our or jQuery's cod execution.

[1] Even if there was a way to not half-abort these requests, we wouldn't want
that. We actually want these requests to reach a dead end. Otherwise we'd get
race conditions where you type "a", "ab", "abc" and after "ab" is intended to
be aborted, it might still arrive *after* "abc" and mess up our search results.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to