Page MenuHomePhabricator

Bug 1815460 - [devtools] Netmonitor waterfall sort should fallback to resource ids
AbandonedPublic

Authored by jdescottes on Feb 9 2023, 6:09 PM.

Details

Summary

resource ids are channel ids and should be incrementally generated. The current id is actually an actor id, meaning it is a string which will lead to incorrect comparisons (eg "Actor10" will be considered "lower" than "Actor2") and also fully depends on the order in which we create the actors.

On some platform / configurations we get identical timestamps for batches of requests, so the fallback mechanism should be reliable

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable
Build Status
Buildable 521005
Build 617667: arc lint + arc unit

Event Timeline

phab-bot published this revision for review.Feb 9 2023, 6:09 PM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

Thanks @jdescottes! This makes sense. Good catch.

Have we ever had id attribute...?

But I'm wondering if we ever fallback to this code.
startedMs seems to be always defined:
https://searchfox.org/mozilla-central/source/devtools/shared/commands/resource/transformers/network-events.js#14
Or is it to explicitely sort request having the exact same startedDateTime?

This revision is now accepted and ready to land.Feb 15 2023, 12:51 PM

Have we ever had id attribute...?

I haven't tracked why, but id here is set to the actorID for the network event.

But I'm wondering if we ever fallback to this code.
startedMs seems to be always defined:
https://searchfox.org/mozilla-central/source/devtools/shared/commands/resource/transformers/network-events.js#14
Or is it to explicitely sort request having the exact same startedDateTime?

Yes that's exactly when this is useful.
And on most platforms this never happens, but on some windows platforms (no idea why) requests seem to be created in batches with the exact same creation time.

This revision now requires review to proceed.Mar 7 2023, 3:20 PM
This revision is now accepted and ready to land.Mar 7 2023, 3:44 PM
This revision is now accepted and ready to land.Mar 24 2023, 8:24 PM

Looks like this now creates issues on windows 11. I think the tests for the netmonitor incorrectly assume some request ordering, and this patch is rather a step in the right direction but since it creates more intermittent issues, let's table it for now.