Selecting a cookie search result doesn't highlight the right target
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(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)
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:
- Open DevTools select the Network panel
- Load http://janodvarko.cz/tests/bugzilla/1713301/
- Click the "Click Me!" button on the page
- Open the Search side panel and search for
test
- Expand the second entry in the search results
- select the first
name1 test
search results (there are two, one representing sent cookie and the other representing received cookie) - 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
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
:Honza, if you think that's a regression, could you try to find a regression range using for example mozregression?
Reporter | ||
Comment 2•3 years ago
|
||
I am unsure whether this is a regression, but it's worth checking out.
Updated•3 years ago
|
Comment 3•3 years ago
|
||
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
Reporter | ||
Comment 4•3 years ago
|
||
Perfect, thank you Alexandru!
I believe that this bug is causing the regression:
Bug 1613881 - Use Accordion for the Cookies Panel
Reporter | ||
Comment 5•3 years ago
•
|
||
Some instructions for anyone interested in fixing this bug:
-
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 -
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
- 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 helpergetSelectedPath
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
- 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
- for response headers https://searchfox.org/mozilla-central/rev/9c9f2f85d00aef1943cb521ac95c72bae932ebc5/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js#568
- for request headers https://searchfox.org/mozilla-central/rev/9c9f2f85d00aef1943cb521ac95c72bae932ebc5/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js#599
The goal is to implement similar function for the Cookies panel (or share it with the HeadersPanel component?) and to the same for cookies
Updated•3 years ago
|
Reporter | ||
Comment 6•3 years ago
|
||
Muhammadali, are you interested in working on this bug?
Honza
Hi Honza,
I am interested to work on this bug.
is it possible to assign it to me?
Mustafa
Reporter | ||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 10•3 years ago
|
||
Comment 11•3 years ago
|
||
bugherder |
Comment 12•3 years ago
|
||
Is this something we should consider uplifting to Beta?
Reporter | ||
Comment 13•3 years ago
|
||
No need to rush this, let's bake it in Nightly.
Thanks for asking though.
Honza
Updated•3 years ago
|
Description
•