-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core: warn if document was redirected #10157
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise :)
@@ -491,6 +504,12 @@ class GatherRunner { | |||
|
|||
// Copy redirected URL to artifact. | |||
baseArtifacts.URL.finalUrl = passContext.url; | |||
if (baseArtifacts.URL.requestedUrl !== baseArtifacts.URL.finalUrl) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should probably use equal without fragments?
@@ -27,6 +27,9 @@ const expectations = [ | |||
}, | |||
}, | |||
}, | |||
runWarnings: [ | |||
/The page may not be loading as expected because your test URL \(.*online-only.html.*\) was redirected to .*redirects-final.html. Try testing the second URL directly./, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a non-deterministic component of this that warrants a regex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this first one - yes, cacheBuster
is a new Date. The second - no. Still good for eliding the URL query params that don't matter.
@@ -102,7 +102,7 @@ module.exports = [ | |||
score: 1, | |||
}, | |||
'works-offline': { | |||
score: 0, | |||
score: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does work offline. Was this meant to be testing something subtle re: redirection? I'm assuming not, since no comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing it didn't always work offline, this test might be 4 years old :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -102,7 +102,7 @@ module.exports = [ | |||
score: 1, | |||
}, | |||
'works-offline': { | |||
score: 0, | |||
score: 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing it didn't always work offline, this test might be 4 years old :)
@@ -491,6 +505,13 @@ class GatherRunner { | |||
|
|||
// Copy redirected URL to artifact. | |||
baseArtifacts.URL.finalUrl = passContext.url; | |||
/* eslint-disable max-len */ | |||
if (!URL.equalWithExcludedFragments(baseArtifacts.URL.requestedUrl, baseArtifacts.URL.finalUrl)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#10218 is going to throw a major wrench into all the places where we detect redirects like this 😆
but a problem for another day
fixes #1917