Closed Bug 1404138 Opened 7 years ago Closed 7 years ago

New web console http inspection completely broken

Categories

(DevTools :: Console, defect, P1)

defect

Tracking

(firefox-esr52 unaffected, firefox56 unaffected, firefox57 unaffected, firefox58 fixed)

RESOLVED FIXED
Firefox 58
Tracking Status
firefox-esr52 --- unaffected
firefox56 --- unaffected
firefox57 --- unaffected
firefox58 --- fixed

People

(Reporter: Kwan, Assigned: Honza)

References

Details

(Keywords: regression)

Attachments

(3 files)

Bug 1371721 completely broke HTTP request inspection in the new web console
Confirmed via mozregression and local backout of
https://hg.mozilla.org/mozilla-central/rev/ac6de5490c42
https://hg.mozilla.org/mozilla-central/rev/707d860b4e2f
https://hg.mozilla.org/mozilla-central/rev/5997563964e1
https://hg.mozilla.org/mozilla-central/rev/48478dfbe1f8
see attached image

old console is unaffected.
Flags: needinfo?(poirot.alex)
Alex, I don't understand exactly the entire patch, but it seems that the problem is that created action objects are not dispatched.

See the diff bellow that fixes it for me.

Also, emitting "network-request-payload-ready" should be done just once probably outside of the cycle.

Honza

---

diff --git a/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js b/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
--- a/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
+++ b/devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
@@ -261,24 +261,24 @@ NewConsoleOutputWrapper.prototype = {
     this.throttledDispatchTimeout = setTimeout(() => {
       this.throttledDispatchTimeout = null;
 
       store.dispatch(actions.messagesAdd(this.queuedMessageAdds));
       this.queuedMessageAdds = [];
 
       if (this.queuedMessageUpdates.length > 0) {
         this.queuedMessageUpdates.forEach(({ message, res }) => {
-          actions.networkMessageUpdate(message);
+          store.dispatch(actions.networkMessageUpdate(message));
           this.jsterm.hud.emit("network-message-updated", res);
         });
         this.queuedMessageUpdates = [];
       }
       if (this.queuedRequestUpdates.length > 0) {
         this.queuedRequestUpdates.forEach(({ id, data}) => {
-          actions.networkUpdateRequest(id, data);
+          store.dispatch(actions.networkUpdateRequest(id, data));
           // Fire an event indicating that all data fetched from
           // the backend has been received. This is based on
           // 'FirefoxDataProvider.isQueuePayloadReady', see more
           // comments in that method.
           // (netmonitor/src/connector/firefox-data-provider).
           // This event might be utilized in tests to find the right
           // time when to finish.
           this.jsterm.hud.emit("network-request-payload-ready", {id, data});
I have also filled bug 1404227 that should improve the existing HTTPi test, so we can avoid regressions like this one.

Honza
(In reply to Jan Honza Odvarko [:Honza] from comment #2)
> Alex, I don't understand exactly the entire patch, but it seems that the
> problem is that created action objects are not dispatched.

Yes... do not hesitate to submit a patch and r? nicolas.

> Also, emitting "network-request-payload-ready" should be done just once
> probably outside of the cycle.

network-request-payload-ready used to send request id and data,
so it should be sent for each request. But I haven't looked at the listeners,
may be they do not need such details...

Looks like there is only a test, which doesn't use arguments:
http://searchfox.org/mozilla-central/source/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_network_messages_expand.js#63

So looks like you are right.
Flags: needinfo?(poirot.alex)
Assignee: nobody → odvarko
Status: NEW → ASSIGNED
Priority: -- → P1
Comment on attachment 8914683 [details]
Bug 1404138 - Properly dispatch actions;

https://reviewboard.mozilla.org/r/185998/#review191026

Looks good, thanks honza

::: devtools/client/webconsole/new-console-output/new-console-output-wrapper.js
(Diff revision 1)
> -          // (netmonitor/src/connector/firefox-data-provider).
> +        // (netmonitor/src/connector/firefox-data-provider).
> -          // This event might be utilized in tests to find the right
> +        // This event might be utilized in tests to find the right
> -          // time when to finish.
> +        // time when to finish.
> -          this.jsterm.hud.emit("network-request-payload-ready", {id, data});
> +        this.jsterm.hud.emit("network-request-payload-ready");
> -        });
> -        this.queuedRequestUpdates = [];

oh
Attachment #8914683 - Flags: review?(nchevobbe) → review+
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9bade53e420b
Properly dispatch actions; r=nchevobbe
https://hg.mozilla.org/mozilla-central/rev/9bade53e420b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: