Closed Bug 1552109 Opened 11 months ago Closed 11 months ago

Filter count is erroneous when a message is filtered by both text and category

Categories

(DevTools :: Console, defect)

defect
Not set

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Regression)

Details

Attachments

(1 file)

Steps to reproduce

  1. Go to data:text/html,<meta charset=utf8><script>console.log("hello"); fetch("https://jsonplaceholder.typicode.com/todos/");</script>
  2. Open the console
  3. Disable the Log filter
  4. Type world in the filter input

Expected results

  • The Log button has a (1) next to it.
  • The filter bar has a message saying 1 item hidden by filters

Actual results

  • The Log button does not have a counter next to it.
  • The filter bar has a message saying 2 items hidden by filters

That's because in the getMessageVisibility function (devtools/client/webconsole/reducers/messages.js#850-855), we are testing the text filter before the categories filter.

Which mean, we'll include non-default messages that are excluded by the text search, and not show the proper counter on default-category buttons.

The counter was erroneous because we were checking
that messages were validating the text input before
checking if they should be visible based on their
category.
Sadly, mocha tests were asserting that we had a bug,
so we fixed them in this patch.

Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e5c0606d155
Fix filter count when text filtering is on. r=bgrins.
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.