Bug 1419336 - Properly update HTTPi UI if a request is opened before finish; r=nchevobbe
MozReview-Commit-ID: GwkGlD1UB9G
--- 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);
};