LongStringActor created with a Promise (not a string) causes exception when reloading page (this.str.substring is not a function)
Categories
(DevTools :: Netmonitor, defect, P2)
Tracking
(firefox-esr115 unaffected, firefox-esr140 unaffected, firefox144 wontfix, firefox145 fixed, firefox146 fixed)
| Tracking | Status | |
|---|---|---|
| firefox-esr115 | --- | unaffected |
| firefox-esr140 | --- | unaffected |
| firefox144 | --- | wontfix |
| firefox145 | --- | fixed |
| firefox146 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: bomsy)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
On https://simple-vt-demos.jakearchibald.com/bounce/ , with DevTools opened, if I reload the page, I'm getting an exception from https://searchfox.org/firefox-main/rev/a5316cedc669bcec09efae23521e0af6b9d3d257/devtools/server/actors/string.js#36
initial: this.str.substring(0, DevToolsServer.LONG_STRING_INITIAL_LENGTH),
exception: this.str.substring is not a function
this is because this.str is a Promise, not a string
The stacktrace points to https://searchfox.org/firefox-main/rev/a5316cedc669bcec09efae23521e0af6b9d3d257/devtools/server/actors/network-monitor/network-event-actor.js#661-667,674
/**
* Add network response content.
*
* @param object content
* The response content.
*/
addResponseContent(content) {
...
content.text = new LongStringActor(this.conn, content.text);
Here, content.text is a Promise
it's build from https://searchfox.org/firefox-main/rev/a5316cedc669bcec09efae23521e0af6b9d3d257/devtools/shared/network-observer/NetworkResponseListener.sys.mjs#564-567,630,633
/**
* Create the response object and send it to the client.
*/
#getResponseContent(data) {
...
response.text = text;
...
this.#httpActivity.owner.addResponseContent(response);
where data is the Promise
it comes from https://searchfox.org/firefox-main/rev/a5316cedc669bcec09efae23521e0af6b9d3d257/devtools/shared/network-observer/NetworkResponseListener.sys.mjs#346,375-377
onStartRequest(request) {
...
if (isOptimizedContent) {
const data = this.#getContentFromCache();
this.#getResponseContent(data);
and indeed #getContentFromCache is async https://searchfox.org/firefox-main/rev/a5316cedc669bcec09efae23521e0af6b9d3d257/devtools/shared/network-observer/NetworkResponseListener.sys.mjs#656
async #getContentFromCache() {
Bomsy, it looks like this might have come from Bug 1830230, can you check?
| Reporter | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•29 days ago
|
||
Thanks Nicholas,
Yes indeed this was likely introduced by the refactoring i did in Bug 1830230.
I was not able to reproduce on the page provided , but was able to reproduce by just refreshing on https://nchevobbe.github.io/demo/console-test-app.html
| Assignee | ||
Comment 2•29 days ago
|
||
Updated•28 days ago
|
Updated•26 days ago
|
Updated•19 days ago
|
Comment 5•19 days ago
|
||
Set release status flags based on info from the regressing bug 1830230
Updated•18 days ago
|
Comment 7•18 days ago
|
||
| bugherder | ||
Comment 8•17 days ago
|
||
The patch landed in nightly and beta is affected.
:bomsy, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox145towontfix.
For more information, please visit BugBot documentation.
Comment 9•17 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined: Will impact users ability to copy all or save all requests as har
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Small js fix
- String changes made/needed: none
- Is Android affected?: no
| Assignee | ||
Comment 10•17 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D270083
| Assignee | ||
Updated•17 days ago
|
Updated•13 days ago
|
Updated•13 days ago
|
Comment 11•11 days ago
|
||
(if this gets uplifted to release, we should take Bug 1991020 as well to avoid frequent test failures)
Updated•6 days ago
|
Updated•6 days ago
|
Comment 12•6 days ago
|
||
| uplift | ||
Description
•