Bug 1419336 - Properly update HTTPi UI if a request is opened before finish; r=nchevobbe draft
authorJan Odvarko <odvarko@gmail.com>
Thu, 07 Dec 2017 12:08:48 +0100
changeset 709684 2fcbbb6848c9fdbff06ffdf1f87d7ada2dcb0e00
parent 709416 457b0fe91e0d49a5bc35014fb6f86729cd5bac9b
child 709685 9d091b9efebdaebe7126da6a82abb1ee3ced31be
push id92714
push userjodvarko@mozilla.com
push dateFri, 08 Dec 2017 14:06:30 +0000
reviewersnchevobbe
bugs1419336
milestone59.0a1
Bug 1419336 - Properly update HTTPi UI if a request is opened before finish; r=nchevobbe MozReview-Commit-ID: GwkGlD1UB9G
devtools/client/webconsole/new-console-output/store.js
--- a/devtools/client/webconsole/new-console-output/store.js
+++ b/devtools/client/webconsole/new-console-output/store.js
@@ -222,22 +222,33 @@ function enableNetProvider(hud) {
             dataProvider.onNetworkEventUpdate(null, {
               packet: { updateType: updateType },
               networkInfo: message,
             });
           });
         }
       }
 
-      // Process all incoming HTTP details packets.
+      // Process all incoming HTTP details packets. Note that
+      // Network event update packets are sent in batches from:
+      // `NewConsoleOutputWrapper.dispatchMessageUpdate` using
+      // NETWORK_MESSAGE_UPDATE action.
+      // Make sure to call `dataProvider.onNetworkEventUpdate`
+      // to fetch data from the backend.
       if (type == NETWORK_MESSAGE_UPDATE) {
         let actor = action.response.networkInfo.actor;
         let open = getAllMessagesUiById(state).includes(actor);
         if (open) {
-          dataProvider.onNetworkEventUpdate(null, action.response);
+          let message = getMessage(state, actor);
+          message.updates.forEach(updateType => {
+            dataProvider.onNetworkEventUpdate(null, {
+              packet: { updateType },
+              networkInfo: message,
+            });
+          });
         }
       }
 
       return newState;
     }
 
     return next(netProviderEnhancer, initialState, enhancer);
   };