Closed Bug 1687192 Opened 4 years ago Closed 4 years ago

Multiple batched request updates with the same id override each other

Categories

(DevTools :: Console, defect)

defect

Tracking

(firefox86 fixed)

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: bomsy, Assigned: bomsy)

References

Details

Attachments

(1 file)

When enabling NETWORK_EVENT/NETWORK_EVENT_STACKTRACE in Bug 1665383. Browser_webconsole_network_messages_stacktrace_console_initiated_request.js test fails intermittently here https://searchfox.org/mozilla-central/rev/6feef3dcfce7e5c922093edde758330857ce2bb3/devtools/client/webconsole/test/browser/browser_webconsole_network_messages_stacktrace_console_initiated_request.js#45. This happens because the stacktrace trace is not shown.

After investigations i discovered that when we get multiple message updates with the same id's batched before the queue is flushed.
e.g

const updates = [
    { id: "server0.conn0.netEvent5" , data: { foo: "123" } },
    { id: "server0.conn0.netEvent5",  data: { bar: "456" } }
];

When redux updates the networkMessagesUpdateById state here https://searchfox.org/mozilla-central/source/devtools/client/webconsole/reducers/messages.js#574-598, the data of the second update overrides the first, instead of augment what is already there.
AR:
After state update

networkMessagesUpdateById = {
   "server0.conn0.netEvent5": { bar: "456" },
    ...
}

ER:
After state update


networkMessagesUpdateById = {
   "server0.conn0.netEvent5": { foo: "123", bar: "456" },
    ...
}

So in the test scenario above, the stacktrace from the first batch update gets overridden by the second batch update even though the second is not explicitly updating the stacktrace. This happens intermittenly because certain times the network response listener might send an update to the frontend from here https://searchfox.org/mozilla-central/rev/6feef3dcfce7e5c922093edde758330857ce2bb3/devtools/server/actors/network-monitor/network-response-listener.js#531-536

Blocks: 1665383

Depends on D102116

Assignee: nobody → hmanilla
Status: NEW → ASSIGNED
Attachment #9197655 - Attachment description: Bug 1687192 - [devtools] Make sure multiple bacth updates with the same id does not override former r=nchevobbe → Bug 1687192 - [devtools] Make sure multiple batch updates with the same id does not override former r=nchevobbe
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/812caf90c2c5
[devtools] Make sure multiple batch updates with the same id does not override former r=nchevobbe
Attachment #9197655 - Attachment description: Bug 1687192 - [devtools] Make sure multiple batch updates with the same id does not override former r=nchevobbe → Bug 1687192 - [devtools] Make sure multiple bacth updates with the same id does not override former r=nchevobbe
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7d1308169ca6
[devtools] Make sure multiple bacth updates with the same id does not override former r=nchevobbe
Flags: needinfo?(hmanilla)
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: