Closed Bug 1575413 Opened 4 months ago Closed 3 months ago

Sorting for long date should be by date and not alphabetical.

Categories

(DevTools :: Netmonitor, defect, P2)

defect

Tracking

(firefox71 fixed)

RESOLVED FIXED
Firefox 71
Tracking Status
firefox71 --- fixed

People

(Reporter: karlcow, Assigned: sorin.davidoi)

Details

(Keywords: good-first-bug)

Attachments

(2 files)

  1. Open the devtools
  2. Go to the network tab
  3. Crtl + Click on the header row (starting with status, etc.)
  4. Add Last Modified from HTTP response.
  5. Go to any website
  6. Click on the Last Modified column top label to sort out.

Expected:
To have the item sorted by date.

Actual:
Items are sorted alphabetically.

Thanks for the report!

I can reproduce that on my machine

Honza

Priority: -- → P2

It seems to be broken for other Response Headers columns too. Try e.g. Response Headers -> Content-Length

Some pointers:

  1. Click on the header is handled here:
    https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/devtools/client/netmonitor/src/components/RequestListHeader.js#118

  2. SortBy action is fired here
    https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/devtools/client/netmonitor/src/components/RequestListHeader.js#616

Notice the type being passed into the action

  1. The reducer storing the current sort type is here
    https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/devtools/client/netmonitor/src/reducers/sort.js#24

  2. When list of requests is rendered getDisplayedREquests selector is called (to get list of sorted requests)
    https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/devtools/client/netmonitor/src/selectors/requests.js#96

  3. The right sort function is based on the type
    https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/devtools/client/netmonitor/src/selectors/requests.js#78

Note the Sorters map

  1. The map of all available sorters is here
    https://searchfox.org/mozilla-central/rev/03853a6e87c4a9405fce1de49e5d03b9e7a7a274/devtools/client/netmonitor/src/utils/sort-predicates.js#188

And see, there is no Last-Modified sorter (not even Content-Length). They need to be implemented

Honza

Keywords: good-first-bug
Assignee: nobody → sorin.davidoi
Status: NEW → ASSIGNED
Pushed by jodvarko@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5def8ed791ed
Implement sorting for Last-Modified and Content-Length response headers. r=Honza
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 71
QA Whiteboard: [qa-71b-p2]
You need to log in before you can comment on or make changes to this bug.