Skip to content

Commit aa64bf0

Browse files
committed
Revert "Bug 1830230 - [devtools] Start sending multiple events as the response data is arrives r=webdriver-reviewers,devtools-reviewers,jdescottes" for causing multiple failures
This reverts commit e2cabf4.
1 parent 18693f0 commit aa64bf0

File tree

18 files changed

+162
-227
lines changed

18 files changed

+162
-227
lines changed

devtools/client/netmonitor/src/components/StatusCode.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const UPDATED_STATUS_PROPS = [
2424
"fromServiceWorker",
2525
"status",
2626
"statusText",
27-
"blockedReason",
2827
];
2928

3029
/**

devtools/client/netmonitor/src/components/request-list/RequestListColumnTransferredSize.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ const UPDATED_TRANSFERRED_PROPS = [
2929
"fromCache",
3030
"isRacing",
3131
"fromServiceWorker",
32-
"blockedReason",
33-
"blockingExtension",
3432
];
3533

3634
class RequestListColumnTransferredSize extends Component {

devtools/client/netmonitor/src/components/request-list/RequestListItem.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ const UPDATED_REQ_ITEM_PROPS = [
173173
"waitingTime",
174174
"isEventStream",
175175
"priority",
176-
"blockedReason",
177-
"blockingExtension",
178176
];
179177

180178
const UPDATED_REQ_PROPS = [

devtools/client/netmonitor/src/utils/request-utils.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,23 +112,13 @@ function fetchNetworkUpdatePacket(requestData, request, updateTypes) {
112112
const promises = [];
113113
if (request) {
114114
updateTypes.forEach(updateType => {
115-
// stackTrace needs to be handled specially as the property to lookup
116-
// on the request object follows a slightly different convention.
117-
// i.e `stacktrace` not `stackTrace`
115+
// Only stackTrace will be handled differently
118116
if (updateType === "stackTrace") {
119117
if (request.cause.stacktraceAvailable && !request.stacktrace) {
120118
promises.push(requestData(request.id, updateType));
121119
}
122120
return;
123121
}
124-
// responseContent only checks the availiability flag as there can
125-
// be multiple response content events
126-
if (updateType === "responseContent") {
127-
if (request.responseContentAvailable) {
128-
promises.push(requestData(request.id, updateType));
129-
}
130-
return;
131-
}
132122

133123
if (request[`${updateType}Available`] && !request[updateType]) {
134124
promises.push(requestData(request.id, updateType));

devtools/client/netmonitor/test/browser_net_chunked-response.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ function setupTestServer() {
4444
}
4545

4646
add_task(async function () {
47+
// TODO: Enable test when Bug 1557795 gets fixed.
48+
// eslint-disable-next-line no-constant-condition
49+
if (true) {
50+
return;
51+
}
4752
const { httpServer, completeResponse } = setupTestServer();
4853
const port = httpServer.identity.primaryPort;
4954

@@ -67,7 +72,7 @@ add_task(async function () {
6772
});
6873
await SpecialPowers.spawn(
6974
tab.linkedBrowser,
70-
[`http://localhost:${port}/chunked-data`],
75+
`http://localhost:${port}/chunked-data`,
7176
async url => {
7277
await content.wrappedJSObject.fetch(url);
7378
}

devtools/client/netmonitor/test/browser_net_domain-not-found.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
* Tests that the request for a domain that is not found shows
88
* correctly.
99
*/
10-
1110
add_task(async function () {
1211
const URL = "https://not-existed.com/";
1312
const { monitor } = await initNetMonitor(URL, {
@@ -32,7 +31,10 @@ add_task(async function () {
3231
const value = firstItem.querySelector(
3332
".requests-list-transferred"
3433
).innerText;
35-
return value.includes("NS_ERROR") ? value : false;
34+
if (value == "") {
35+
return false;
36+
}
37+
return value;
3638
});
3739

3840
is(

devtools/client/netmonitor/test/browser_net_sse-basic.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,11 @@ add_task(async function testBasicServerSentEvents() {
213213
* 3) Assert that the close connection message is displayed when the connection is closed.
214214
*/
215215
add_task(async function testServerSentEventsDetails() {
216+
// TODO: Should enable this test when Bug 1557795 gets fixed.
217+
// eslint-disable-next-line no-constant-condition
218+
if (true) {
219+
return null;
220+
}
216221
const { httpServer, sendResponseMessages, completeResponse } =
217222
setupTestServer();
218223
const port = httpServer.identity.primaryPort;
@@ -274,7 +279,7 @@ add_task(async function testServerSentEventsDetails() {
274279
const waitForMoreMessages = waitForDOM(
275280
document,
276281
"#messages-view .message-list-table .message-list-item",
277-
4
282+
3
278283
);
279284
info("Send a couple of more messages");
280285
sendResponseMessages();

devtools/server/actors/network-monitor/network-event-actor.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -638,33 +638,14 @@ class NetworkEventActor extends Actor {
638638
});
639639
}
640640

641-
/**
642-
* Add network response content end.
643-
*
644-
* @param object
645-
*/
646-
addResponseContentComplete({ blockedReason, blockingExtension }) {
647-
// Ignore calls when this actor is already destroyed
648-
if (this.isDestroyed()) {
649-
return;
650-
}
651-
652-
this._onEventUpdate(
653-
lazy.NetworkUtils.NETWORK_EVENT_TYPES.RESPONSE_CONTENT_COMPLETE,
654-
{
655-
blockedReason,
656-
blockingExtension,
657-
}
658-
);
659-
}
660-
661641
/**
662642
* Add network response content.
663643
*
664644
* @param object content
665645
* The response content.
646+
* @param object
666647
*/
667-
addResponseContent(content) {
648+
addResponseContent(content, { blockedReason, blockingExtension }) {
668649
// Ignore calls when this actor is already destroyed
669650
if (this.isDestroyed()) {
670651
return;
@@ -683,6 +664,8 @@ class NetworkEventActor extends Actor {
683664
mimeType: content.mimeType,
684665
contentSize: content.size,
685666
transferredSize: content.transferredSize,
667+
blockedReason,
668+
blockingExtension,
686669
}
687670
);
688671
}

devtools/server/actors/resources/network-events-content.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,15 @@ class NetworkEventContentWatcher {
231231
{} /* offsets */
232232
);
233233
networkEventActor.addServerTimings({});
234-
networkEventActor.addResponseContent({
235-
mimeType: channel.contentType,
236-
size: channel.contentLength,
237-
text: "",
238-
transferredSize: 0,
239-
});
240-
networkEventActor.addResponseContentComplete({});
234+
networkEventActor.addResponseContent(
235+
{
236+
mimeType: channel.contentType,
237+
size: channel.contentLength,
238+
text: "",
239+
transferredSize: 0,
240+
},
241+
{}
242+
);
241243
} else if (type == RESOURCE_TYPES.DATA_CHANNEL) {
242244
lazy.NetworkUtils.handleDataChannel(channel, networkEventActor);
243245
}

devtools/server/actors/resources/network-events.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,6 @@ class NetworkEventWatcher {
403403
resourceUpdates.contentSize = updateResource.contentSize;
404404
resourceUpdates.transferredSize = updateResource.transferredSize;
405405
resourceUpdates.mimeType = updateResource.mimeType;
406-
break;
407-
case NETWORK_EVENT_TYPES.RESPONSE_CONTENT_COMPLETE:
408406
resourceUpdates.blockingExtension = updateResource.blockingExtension;
409407
resourceUpdates.blockedReason = updateResource.blockedReason;
410408
break;
@@ -425,7 +423,7 @@ class NetworkEventWatcher {
425423

426424
const isResponseComplete =
427425
receivedUpdates.includes(NETWORK_EVENT_TYPES.EVENT_TIMINGS) &&
428-
receivedUpdates.includes(NETWORK_EVENT_TYPES.RESPONSE_CONTENT_COMPLETE) &&
426+
receivedUpdates.includes(NETWORK_EVENT_TYPES.RESPONSE_CONTENT) &&
429427
receivedUpdates.includes(NETWORK_EVENT_TYPES.SECURITY_INFO);
430428

431429
if (isResponseComplete) {
@@ -438,7 +436,6 @@ class NetworkEventWatcher {
438436

439437
if (
440438
updateResource.updateType == NETWORK_EVENT_TYPES.RESPONSE_START ||
441-
updateResource.updateType == NETWORK_EVENT_TYPES.RESPONSE_CONTENT ||
442439
isResponseComplete
443440
) {
444441
this._emitUpdate(networkEvent);

0 commit comments

Comments
 (0)