Sorting by 'Transferred' in the Network pane of the Developer Tools does not work as expected
Categories
(DevTools :: Netmonitor, defect, P2)
Tracking
(firefox71 verified, firefox72 verified)
People
(Reporter: mikael, Assigned: MonikaMaheshwari)
Details
(Keywords: good-first-bug)
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Steps to reproduce:
Open the Developer Tools on any web page, select "Network", then click the header for the "Transferred" column
Actual results:
Column items are sorted in a seemingly random order
Expected results:
Some form of alphanumeric grouping, or as dictated by the character encoding
Updated•5 years ago
|
Comment 1•5 years ago
|
||
Thanks for the report!
I can reproduce on my machine.
Honza
Assignee | ||
Comment 2•5 years ago
|
||
Can I work on this issue?
Comment 3•5 years ago
|
||
Yes, please. Assigned to you.
Honza
Assignee | ||
Comment 4•5 years ago
|
||
Transferred : cached
needs to be sorted in alphabetical order?
Comment 5•5 years ago
|
||
It looks like Monika was asking a question there, but no needinfo flag was set. Let me set it so Honza can see it and help Monika.
Comment 6•5 years ago
|
||
(In reply to Monika Maheshwari [:MonikaMaheshwari] from comment #4)
Transferred : cached
needs to be sorted in alphabetical order?
Yes
Some more comments:
-
The code that renders a number (transferred size) or a label is here:
https://searchfox.org/mozilla-central/rev/ec806131cb7bcd1c26c254d25cd5ab8a61b2aeb6/devtools/client/netmonitor/src/components/RequestListColumnTransferredSize.js#52-67 -
The sorting function for the Transferred columns is here:
https://searchfox.org/mozilla-central/rev/ec806131cb7bcd1c26c254d25cd5ab8a61b2aeb6/devtools/client/netmonitor/src/utils/sort-predicates.js#179 -
Using the default sorter
compareValues
isn't enough, since it just comparesfirst.transferredSize
, but the column might render a label instead (even if the transferredSize is a valid number) -
So, the sorter should use similar logic as the
RequestListColumnTransferredSize
(#1) component that returns the actual label being displayed. An utility function likegetTransferedSizeValue
(or better) would be helpful here.
Be careful not to compare result of getFormattedSize(transferredSize);
that wouldn't work properly.
- When the sorter is comparing actual (displayed) values, it should convert them to strings an compare (comparing numbers as string should work as expected.
Honza
Assignee | ||
Comment 7•5 years ago
|
||
Network pane of the Developer Tools
Assignee | ||
Comment 8•5 years ago
|
||
Hey now it is comparing actual displayed value in comparator but then also not getting proper sorting.
Assignee | ||
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Pushed by jodvarko@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/44cbc078bbdd transferred sort change r=Honza
Comment 11•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Comment 12•5 years ago
|
||
Hello,
Managed to reproduce this issue with 69.0a1(buildID:20190630214222)
Confirming this issue as verified fixed on 71.0b7(buildID:20191104135555) and 72.0a1 (buildID:20191104214406). Verified using Windows 10x64, Ubuntu 18.04 and macOS 10.14.
Description
•