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

Cleanup Network Handling in Gatherers #11454

Open
6 tasks
patrickhulce opened this issue Sep 18, 2020 · 0 comments
Open
6 tasks

Cleanup Network Handling in Gatherers #11454

patrickhulce opened this issue Sep 18, 2020 · 0 comments
Labels

Comments

@patrickhulce
Copy link
Collaborator

patrickhulce commented Sep 18, 2020

Summary
The root cause of #11450 was that we link up network records and image elements using record.url === image.src but this breaks down for images that redirected. I looked around and it seems like many, many audits might be susceptible to a similar pitfall.

A few more things that came to mind we should probably fix in this space...

  • Extract a shared findMatchingNetworkRecord function that can handle this redirect logic, do the *ByUrl nonsense that we have duplicated everywhere, etc
  • Remove duplicated resourceSize in ImageElements that duplicates network record property (breaking change, ref ☂️ 👣 Breaking changes for v7 #11207)
  • Check the redirect URL reporting behavior of...
    • ScriptElements
    • CSSUsage
    • JsUsage

i.e. when we create our map of URL -> network record we shouldn't just use URL, but also use..

// Also index all of its redirect source.
let originalRequest = record;
while (originalRequest.redirectSource) originalRequest = originalRequest.redirectSource;
map[originalRequest.url] = record;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants