Closed Bug 1719266 Opened 3 years ago Closed 3 years ago

Selecting a cookie search result doesn't highlight the right target

Categories

(DevTools :: Netmonitor, defect, P3)

defect

Tracking

(firefox-esr78 wontfix, firefox-esr91 wontfix, firefox91 wontfix, firefox92 wontfix, firefox93 fixed)

RESOLVED FIXED
93 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox-esr91 --- wontfix
firefox91 --- wontfix
firefox92 --- wontfix
firefox93 --- fixed

People

(Reporter: Honza, Assigned: mustafa.abdelmogoud, Mentored)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: good-first-bug, regression)

Attachments

(3 files)

Attached image image.png

When selecting a search result that represents a sent or received cookie the Cookies side panel is selected but both send and received cookie is selected in it.

STR:

  1. Open DevTools select the Network panel
  2. Load http://janodvarko.cz/tests/bugzilla/1713301/
  3. Click the "Click Me!" button on the page
  4. Open the Search side panel and search for test
  5. Expand the second entry in the search results
  6. select the first name1 test search results (there are two, one representing sent cookie and the other representing received cookie)
  7. The Cookies side panel is properly selected but both cookies in it (received and sent) are highlighted

ER: just the one proper cookie should be selected in the Cookies side panel

Honza

Has STR: --- → yes

:Honza, if you think that's a regression, could you try to find a regression range using for example mozregression?

I am unsure whether this is a regression, but it's worth checking out.

QA Whiteboard: [qa-regression-triage]

Hello! Attaching regression range made on Windows 10x64. Hope it helps.

Last good revision: 99066bbd1b3a288471f2bf7f59f1c99da42610a1 (2020-02-11)
First bad revision: e84a0546e6e2e1f7a7b5912c86e3e3cab311555c (2020-02-12)
Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=99066bbd1b3a288471f2bf7f59f1c99da42610a1&tochange=e84a0546e6e2e1f7a7b5912c86e3e3cab311555c

Has Regression Range: --- → yes

Perfect, thank you Alexandru!

I believe that this bug is causing the regression:
Bug 1613881 - Use Accordion for the Cookies Panel

Regressed by: 1613881

Some instructions for anyone interested in fixing this bug:

  1. The Cookies panel is rendered using CookiesPanel component
    https://searchfox.org/mozilla-central/rev/9c9f2f85d00aef1943cb521ac95c72bae932ebc5/devtools/client/netmonitor/src/components/request-details/CookiesPanel.js#42-46

  2. Request and Response cookies lists are rendered using PropertiesView component (each list using its own instance)
    https://searchfox.org/mozilla-central/rev/9c9f2f85d00aef1943cb521ac95c72bae932ebc5/devtools/client/netmonitor/src/components/request-details/CookiesPanel.js#122-150

Note that the panel passes targetSearchResult object into the PropertiesView component as a property

  1. The PropertiesView is selecting its items using this logic
    https://searchfox.org/mozilla-central/rev/9c9f2f85d00aef1943cb521ac95c72bae932ebc5/devtools/client/netmonitor/src/components/request-details/PropertiesView.js#221-224
  • Either using the targetSearchResult prop and helper getSelectedPath method (which is the case in the Cookies panel)
  • Or using custom selectPath function passed in as prop

The default getSelectedPath is too simple and just returns targetSearchResult.label, which is the same for both sent/received cookie - thus both are selected -> BUG

We need to pass a custom selectPath function in the PropertiesView

  1. Luckily the Headers panel does the same
    https://searchfox.org/mozilla-central/rev/9c9f2f85d00aef1943cb521ac95c72bae932ebc5/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js#286-291

It implements a function that returns proper path that is used to generate tree-identifier (a path) utilized by the PropertiesView to know, which item should be selected. Note that headers are also rendered using the PropertiesView component.

The function is passed into the PropertiesView

The goal is to implement similar function for the Cookies panel (or share it with the HeadersPanel component?) and to the same for cookies

Mentor: odvarko
Keywords: good-first-bug
Flags: needinfo?(odvarko)

Muhammadali, are you interested in working on this bug?

Honza

Flags: needinfo?(odvarko) → needinfo?(vazhayil71)

Hi Honza,

I am interested to work on this bug.
is it possible to assign it to me?

Mustafa

Assignee: nobody → mustafa.abdelmogoud
Status: NEW → ASSIGNED

remove left-padding in cookiesPanel

Attachment #9235103 - Attachment description: WIP: Bug 1719266 - highlight the right selected cookie. :Honza → WIP: Bug 1719266 - [devtools] Highlight the right selected cookie. :Honza
Attachment #9235103 - Attachment description: WIP: Bug 1719266 - [devtools] Highlight the right selected cookie. :Honza → Bug 1719266 - [devtools] Highlight the right selected cookie. :Honza
Attachment #9235103 - Attachment description: Bug 1719266 - [devtools] Highlight the right selected cookie. :Honza → WIP: Bug 1719266 - highlight the right selected cookie. :Honza
Attachment #9235103 - Attachment description: WIP: Bug 1719266 - highlight the right selected cookie. :Honza → Bug 1719266 - [devtools] Highlight the right selected cookie. :Honza
Pushed by jodvarko@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4051d2792ad2 [devtools] Highlight the right selected cookie. :Honza r=Honza DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

Is this something we should consider uplifting to Beta?

Flags: needinfo?(vazhayil71) → needinfo?(odvarko)

No need to rush this, let's bake it in Nightly.
Thanks for asking though.
Honza

Flags: needinfo?(odvarko)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: