-
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(network-recorder): redirects started by script are set as initiators #7352
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!
though would you find forcing lantern smoketests to run? we should add "network-recorder" and "network-request" to the list of files that force a lantern run in travis
for now you can make a bogus commit or something that touches lantern stuff?
@@ -368,7 +368,7 @@ class NetworkRecorder extends EventEmitter { | |||
for (const record of records) { | |||
const stackFrames = (record.initiator.stack && record.initiator.stack.callFrames) || []; | |||
const initiatorURL = record.initiator.url || (stackFrames[0] && stackFrames[0].url); | |||
const initiator = recordsByURL.get(initiatorURL) || record.redirectSource; |
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.
presumably there was some reason I fellback this way but I have no idea what is was at this point and this seems to make more sense, so..... cool!
maybe add a comment so we don't forget again?
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, though it makes me nervous that we had no tests that failed when switching those around :)
Co-Authored-By: paulirish <paul.irish@gmail.com>
Given this test page:
We'd expect to see a request chain like so:
But we currently see this instead:
This PR resolves this.
Our technique of setting initiator was mostly considering network redirects of the main document, but not when the initiator was Script. A quick logic fix later and we're good.
I ran into this while looking at #6704 and #6675.