-
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(redirects): use requestId instead of URL to find requests #14838
Conversation
* GET /thirdRedirect => 302 /mainDocumentUrl | ||
* GET /mainDocumentUrl => 200 /mainDocumentUrl |
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.
not that important, but this didn't quite make sense (there had to be one last redirect)
// Use the main resource as a backup if we didn't find any modern navigationStart events | ||
return (mainResource.redirects || []).concat(mainResource); |
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 is for super ancient traces (like m60, maybe), and there are no tests hitting this, so no need to keep it around.
@@ -96,10 +98,10 @@ class Redirects extends Audit { | |||
const metricResult = await LanternInteractive.request(metricComputationData, context); | |||
|
|||
/** @type {Map<string, LH.Gatherer.Simulation.NodeTiming>} */ | |||
const nodeTimingsByUrl = new Map(); |
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.
similar to the navigationId
change above, this gets confused if there are multiple resources per URL. The graph has the full records, so this can match on the actual unique ID.
@@ -709,7 +709,7 @@ declare module Artifacts { | |||
timestamps: TraceTimes; | |||
/** The relative times from timeOrigin to key events, in milliseconds. */ | |||
timings: TraceTimes; | |||
/** The subset of trace events from the page's process, sorted by timestamp. */ | |||
/** The subset of trace events from the main frame's process, sorted by timestamp. Due to cross-origin navigations, the main frame may have multiple processes, so events may be from more than one process. */ |
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.
Tried to clarify what "processEvents" means after @paulirish's change in #14287
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, good upgrades to redirects smoke tests
b91c8a5
to
6c563ed
Compare
Pages that do a js redirect to themselves (e.g. found pages doing some janky A/B testing that would reload after doing a sync XHR) were getting no feedback from the
redirects
audit because the audit was matching requests to navStarts by URL. Repeated navStarts to the same URL would always resolve to the first network request, so the audit would say the redirects took 0ms.Instead, this PR looks at the navStart
navigationId
, which matches network requests'requestId
for navigation requests.Also adds redirect assertions to all the
redirect-*
smoke tests, because we don't have great trace fixture coverage of redirect cases, but we do have great smoke test coverage of them.