Closed Bug 1562464 Opened 5 years ago Closed 5 years ago

Sorting by 'Transferred' in the Network pane of the Developer Tools does not work as expected

Categories

(DevTools :: Netmonitor, defect, P2)

67 Branch
defect

Tracking

(firefox71 verified, firefox72 verified)

VERIFIED FIXED
Firefox 71
Tracking Status
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

Component: Untriaged → Netmonitor
Product: Firefox → DevTools

Thanks for the report!
I can reproduce on my machine.

Honza

Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: good-first-bug
Priority: -- → P2

Can I work on this issue?

Yes, please. Assigned to you.

Honza

Assignee: nobody → monikamaheshwari1996
Status: NEW → ASSIGNED

Transferred : cached needs to be sorted in alphabetical order?

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.

Flags: needinfo?(odvarko)

(In reply to Monika Maheshwari [:MonikaMaheshwari] from comment #4)

Transferred : cached needs to be sorted in alphabetical order?

Yes

Some more comments:

  1. 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

  2. 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

  3. Using the default sorter compareValues isn't enough, since it just compares first.transferredSize, but the column might render a label instead (even if the transferredSize is a valid number)

  4. So, the sorter should use similar logic as the RequestListColumnTransferredSize (#1) component that returns the actual label being displayed. An utility function like getTransferedSizeValue (or better) would be helpful here.

Be careful not to compare result of getFormattedSize(transferredSize); that wouldn't work properly.

  1. 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

Flags: needinfo?(odvarko)

Network pane of the Developer Tools

Hey now it is comparing actual displayed value in comparator but then also not getting proper sorting.

Flags: needinfo?(odvarko)

Thanks for the update!

Commented in Phab.

Honza

Flags: needinfo?(odvarko)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71

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.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: