Home Dashboard Directory Help
Search

IE10 Dynamic Script Loading Bug - async + 404s by Satyen Desai


Status: 

Closed
 as Won't Fix Help for as Won't Fix


Type: Bug
ID: 763466
Opened: 9/19/2012 12:04:57 AM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

When dynamically injecting script elements with async explicitly set to false, if you insert 2 script nodes with the *same* src which 404s, the next script with a valid (200, 304 etc.) src hangs, and does not invoke the onload listener.

Test case is attached.

This impacts YUI's Get utility, which is used to dynamically include scripts to the page. We use the DOM0 onload and onerror listeners, instead of onreadystatechange, because we need to identify error and success cases for loading (since it's a generic utility, we can't check for something which the scripts may be adding). Also, I believe there are some use cases where onreadystatechange doesn't reliably indicate "interpreted", only "downloaded".
Details
Sign in to post a comment.
Posted by Satyen Desai on 10/8/2012 at 3:30 PM
Is it still in consideration for a future release? If so, is this still where I'd track when it's going in?
Posted by Microsoft on 10/8/2012 at 3:01 PM
Thank you again for your feedback.

We were able to validate your feedback. However, based on the limited impact this bug may have, we will not be able to address this bug during this release.

Your feedback is very important to us, and it helps us improve the quality of Internet Explorer. We continue to welcome more feedback, so please don't hesitate to report other ways that we can improve Internet Explorer.

Best regards,

The Internet Explorer Team
Posted by Microsoft on 9/26/2012 at 10:36 AM
Thank you for your feedback.

We were able to reproduce the issue and are investigating it.

Best regards,

The Internet Explorer Team
Posted by Satyen Desai on 9/26/2012 at 10:21 AM
We just finished some testing on WinJS packaged apps, and this problem seems to occur there also (and is easier to hit, because it seems to treat "someResource.js?t=12345" and "someResource.js?t=9876" as "someResource.js" and so it's easier to hit the bug - because it's easier to insert a script with the same URL twice [ the ? part gets normalized out ].
Posted by Satyen Desai on 9/25/2012 at 2:44 PM
To be clear - I don't think there was anything to correct in my original test case - it was valid.

I just posted the other one in case that's more obvious for you, but in my mind it just complicates the simpler repro I provided originally.
Posted by Satyen Desai on 9/25/2012 at 2:40 PM
Right, the signature of the addScript() call is:

addScript(url, successListener, errorListener);

And the addScript implementation is designed to take care of the following calls (which are all valid):

    addScript("a.js", function success(){}), as well as:
    addScript("a.js", function success(){}, function error(){}), as well as:
    addScript("a.js", null, function error(){});

The arguments just allow you do additional stuff in the onload or onerror handler for the script.

So, what my original implementation was doing was adding a script node, with additional stuff being logged in a success listener, and no error listener.

By changing addScript("a.js", function()) to addScript("a.js", null, function()), what you were effectively doing was adding a log statement saying "a.js success" to the error handler for the script node.

I imagine the reason you see it logged is because you didn't deploy the "a.js" file along-side the test page, so it's firing the script's onerror handler when it gets another 404 trying to find "a.js" (if you post the complete log, you'll probably see a "onerror fired" before the "a.js" success and no "a.js is interpreted" in the log?)

Can you confirm this? Can you share the complete console.log stack after you changed the test case?

I added a slightly modified version of the test to: http://yuiblog.com/sandbox/ie10_bugs/script-ie10-v2.html just to so that I'm explicitly passing functions for both the error and success arguments - and I still see the issue on the above v2 page.
Posted by Microsoft on 9/25/2012 at 1:23 PM
Thank you for your feedback.

We are currently unable to reproduce this issue as described.

We found that your addscript function expects 3 parameters, So correcting your code " addScript("a.js", function()) " to addScript("a.js", null, function()) gets "a.js success" comment on console.

We value your feedback. If you have additional information that can help us recreate this issue

Best regards,

The Internet Explorer Team
Sign in to post a workaround.