Closed Bug 1930848 Opened 4 months ago Closed 3 months ago

Log instead of throwing when responseCompleted is skipped due to a missing responseStarted event

Categories

(Remote Protocol :: WebDriver BiDi, defect, P2)

defect

Tracking

(firefox135 fixed)

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: jdescottes, Assigned: peshannon104, Mentored)

References

(Blocks 1 open bug)

Details

(Whiteboard: [lang=js][webdriver:m14][webdriver:external][webdriver:relnote])

Attachments

(1 file, 1 obsolete file)

At the moment, we have relatively frequent log pollution due to network events which are missing the responseStarted event. This usually shows up in the logs as

JavaScript error: chrome://remote/content/shared/listeners/NetworkEventRecord.sys.mjs, line 328: TypeError: can't access property "setResponseSizes", this[#response] is null

We should investigate individual cases which lead to missing events, but at the moment we don't even log the URL of the skipped event, so it makes it difficult to investigate.

I suggest to add a guard at https://searchfox.org/mozilla-central/rev/55837bbe3e47f9b4fa91ef83a44b53823626f01d/remote/shared/listeners/NetworkEventRecord.sys.mjs#328

this.#response.setResponseSizes(sizes);
Mentor: jdescottes
Points: --- → 2
Priority: -- → P2
Whiteboard: [lang=js][webdriver:backlog]

The severity field is not set for this bug.
:whimboo, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(hskupin)
Severity: -- → S3
Flags: needinfo?(hskupin)

Hey! Looking for my first contribution, have 5 years JS and backend experience. Seems like an easy first contribution, if it is still up for grabs.

I am looking to build up my opensource contributions!

(In reply to Patrick Shannon from comment #2)

Hey! Looking for my first contribution, have 5 years JS and backend experience. Seems like an easy first contribution, if it is still up for grabs.

I am looking to build up my opensource contributions!

Hi Patrick!

Yes it's still available, just submit a patch and the bug will automatically be assigned to you. Our getting started docs should cover everything you need to do that: https://firefox-source-docs.mozilla.org/setup/index.html , but if you need help feel free to reach out on https://chat.mozilla.org

Assignee: nobody → peshannon104
Status: NEW → ASSIGNED
Attachment #9441093 - Attachment description: Bug 1930848 - Added a check for response before setting size and emitting response completed. These two functions depend on response and it was reported that there are some cases where response can be null at this point. r=jdescottes,whimboo → Bug 1930848 - [remote]Improve logging in NetworkEventRecord for cases where missing response info. Added warning log with skipped request url. r=jdescottes
Attachment #9441126 - Attachment is obsolete: true
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/feed28df23eb [remote]Improve logging in NetworkEventRecord for cases where missing response info. Added warning log with skipped request url. r=jdescottes,webdriver-reviewers
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
Points: 2 → ---
Whiteboard: [lang=js][webdriver:backlog] → [lang=js][webdriver:m14][webdriver:external]
Whiteboard: [lang=js][webdriver:m14][webdriver:external] → [lang=js][webdriver:m14][webdriver:external][webdriver:relnote]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: