Bug 1421335 - Right response info link disappears after request is expanded; r=nchevobbe

MozReview-Commit-ID: 5WEqPQaWGGt

--HG--
extra : rebase_source : eaf338dcf3ea3a1c4c3644cc4a1a2c2c988cbd9f
This commit is contained in:
Jan Odvarko 2017-12-07 16:28:33 +01:00
Родитель 9b8d78724d
Коммит 8671511dd6
3 изменённых файлов: 18 добавлений и 19 удалений

Просмотреть файл

@ -341,7 +341,13 @@ class FirefoxDataProvider {
});
break;
case "eventTimings":
this.pushRequestToQueue(actor, { totalTime: networkInfo.totalTime });
// Total time doesn't have to be always set e.g. net provider enhancer
// in Console panel is using this method to fetch data when network log
// is expanded. So, make sure to not push undefined into the payload queue
// (it could overwrite an existing value).
if (typeof networkInfo.totalTime != "undefined") {
this.pushRequestToQueue(actor, { totalTime: networkInfo.totalTime });
}
await this._requestData(actor, updateType);
break;
}

Просмотреть файл

@ -65,6 +65,7 @@ function addMessage(state, filtersState, prefsState, newMessage) {
repeatById,
visibleMessages,
filteredMessagesCount,
networkMessagesUpdateById,
} = state;
if (newMessage.type === constants.MESSAGE_TYPE.NULL_MESSAGE) {
@ -136,6 +137,14 @@ function addMessage(state, filtersState, prefsState, newMessage) {
};
}
// Append received network-data also into networkMessagesUpdateById
// that is responsible for collecting (lazy loaded) HTTP payload data.
if (newMessage.source == "network") {
newState.networkMessagesUpdateById = Object.assign({}, networkMessagesUpdateById, {
[newMessage.actor]: newMessage
});
}
return newState;
}

Просмотреть файл

@ -198,25 +198,9 @@ function enableNetProvider(hud) {
// received. The rest of updates will be handled below, see:
// NETWORK_MESSAGE_UPDATE action handler.
if (type == MESSAGE_OPEN) {
let message = getMessage(state, action.id);
let updates = getAllNetworkMessagesUpdateById(newState);
let message = updates[action.id];
if (!message.openedOnce && message.source == "network") {
let updates = getAllNetworkMessagesUpdateById(newState);
// If there is no network request update received for this
// request-log, it's likely that it comes from cache.
// I.e. it's been executed before the console panel started
// listening from network events. Let fix that by updating
// the reducer now.
// Executing the reducer means that the `networkMessagesUpdateById`
// is updated (a actor key created). The key is needed for proper
// handling NETWORK_UPDATE_REQUEST event (in the same reducer).
if (!updates[action.id]) {
newState = reducer(newState, {
type: NETWORK_MESSAGE_UPDATE,
message: message,
});
}
dataProvider.onNetworkEvent(null, message);
message.updates.forEach(updateType => {
dataProvider.onNetworkEventUpdate(null, {