Bug 61473
| Summary: | REGRESSION (r67163): twitter.com doesn't load properly the first time | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Andy Estes <aestes> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Critical | CC: | abarth, aestes, eoconnor, esprehn, tonyg |
| Priority: | P1 | Keywords: | InRadar, NeedsReduction, Regression |
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://twitter.com | ||
| Bug Depends on: | 45310 | ||
| Bug Blocks: | |||
Andy Estes
In some cases, twitter.com fails to load the timeline with a cold cache. The black toolbar loads, but a JavaScript error prevents the rest of the page from loading. The error is typically something like:
TypeError: 'undefined' is not an object (evaluating 'twttr.anywhere.api')
See the attached screenshot to see what the page looks like when this happens.
The problem seems to be specific to a subset of twitter accounts and usually goes away if you reload the page. Since I am able to see this error, I'll work on a reduction.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Andy Estes
<rdar://problem/9491632>
Andy Estes
This is a regression due to <http://trac.webkit.org/changeset/67163>
Andy Estes
There is a JavaScript function in the main document called initAPI() that calls twttr.anywhere.api.initialize().
twttr.anywhere.api is defined in an external resource that is included earlier in the main document using:
<script type="text/javascript" async="" src="https://si1.twimg.com/a/1306171173/javascripts/api.bundle.js"></script>
Since the script tag has the async attribute, it can load after initAPI() executes. Sounds like a race condition.
Adam Barth
Sounds like we should evangelize them to not use async and rely on script ordering!
Theresa O'Connor
I've evang'ed; they already knew about this, and have a fix on the way.
Andy Estes
(In reply to comment #5)
> I've evang'ed; they already knew about this, and have a fix on the way.
That's great! Do you have any sense of timeframe so we know when to verify the fix?
Theresa O'Connor
I'll ask.
Elliott Sprehn
They don't even include the referenced script anymore and it appears they're using async more carefully.