Bug 114480

Summary: REGRESSION (r141136): Wiki "Random article" function very broken
Product: WebKit Reporter: Brady Eidson <beidson>
Component: Page LoadingAssignee: Brady Eidson <beidson>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, commit-queue, japhet
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch v1 ap: review+

Description Brady Eidson 2013-04-11 16:55:54 PDT
REGRESSION (r141136): Wiki "Random article" function very broken

When main resources are in the memory cache, they are keyed off http://en.wikipedia.org/wiki/Special:Random
Even though http://en.wikipedia.org/wiki/Special:Random redirects to a random article each time.

So we start to revalidate the resource with wikipedia, and it redirects the revalidation request.

In our new redirect request, we still issue a conditional GET to try to revalidate the new request, and that gives us back a 304.  So we update our URLs but use the main resource text from the previous article.

If the redirect URL differs from the CachedResource we're trying to revalidate, we should stop trying to revalidate and issue an unconditional GET.

In radar as <rdar://problem/13229985>
Comment 1 Brady Eidson 2013-04-12 16:58:02 PDT
Created attachment 197910 [details]
Patch v1

Still making sure I didn't break any other layout tests, but this is my plan.
Comment 2 Alexey Proskuryakov 2013-04-12 21:18:57 PDT
Comment on attachment 197910 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=197910&action=review

Does SubresourceLoader cover all the resources that may be affected?

> Source/WebCore/loader/SubresourceLoader.cpp:137
> +        // If this redirect takes us somewhere besides the final response URL of the resource we're revalidating,
> +        // then make this an unconditional GET request.

I think that this "what" comment adds some value, but a "why" one would be even better.
Comment 3 Brady Eidson 2013-04-12 21:52:34 PDT
(In reply to comment #2)
> (From update of attachment 197910 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=197910&action=review
> 
> Does SubresourceLoader cover all the resources that may be affected?

SubresourceLoader is the only thing that revalidates CachedResources, so it's an appropriate catch-all for accidentally reusing previously loaded resources.

> > Source/WebCore/loader/SubresourceLoader.cpp:137
> > +        // If this redirect takes us somewhere besides the final response URL of the resource we're revalidating,
> > +        // then make this an unconditional GET request.
> 
> I think that this "what" comment adds some value, but a "why" one would be even better.

I can definitely improve this.
Comment 4 Brady Eidson 2013-04-22 16:26:18 PDT
EWS never churned all the way through this, and running tests locally is proving to be a hit-or-miss PITA.

I need to move forward with this one and watch the actual testers afterwards.
Comment 5 Brady Eidson 2013-04-22 16:27:59 PDT
http://trac.webkit.org/changeset/148929
Comment 6 Brady Eidson 2013-04-22 16:30:14 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > > Source/WebCore/loader/SubresourceLoader.cpp:137
> > > +        // If this redirect takes us somewhere besides the final response URL of the resource we're revalidating,
> > > +        // then make this an unconditional GET request.
> > 
> > I think that this "what" comment adds some value, but a "why" one would be even better.
> 
> I can definitely improve this.

Since I'd worked on other things for ~9 days, I forgot to address this comment.  My apologies.  Will fix in a followup
Comment 7 Brady Eidson 2013-04-22 16:41:26 PDT
Followed up in http://trac.webkit.org/changeset/148932