Skip to content
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

Merged
merged 5 commits into from
Jan 14, 2020
Merged

core: warn if document was redirected #10157

merged 5 commits into from
Jan 14, 2020

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Dec 30, 2019

fixes #1917

image

Copy link
Collaborator

@patrickhulce patrickhulce left a 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) {
Copy link
Collaborator

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./,
Copy link
Collaborator

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?

Copy link
Collaborator Author

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,
Copy link
Collaborator Author

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.

Copy link
Collaborator

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 :)

Copy link
Collaborator

@patrickhulce patrickhulce left a 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,
Copy link
Collaborator

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)) {
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report: top-level warn if initialUrl and finalUrl are different
3 participants