Closed Bug 1939597 Opened 2 months ago Closed 2 months ago

“Search open tabs” feature doesn’t find ERROR pages

Categories

(Firefox :: Address Bar, defect, P3)

Firefox 128
ARM64
macOS
defect

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: green-coder, Assigned: mak)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sng])

Attachments

(4 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:128.0) Gecko/20100101 Firefox/128.0

Steps to reproduce:

Let’s consider these three of my 600+ open tabs:

  1. https://exercism.org/tracks/python/exercises (titled “Python exercises on Exercism”)
  2. https://exercism.org/tracks/python/exercises/zebra-puzzle/mentor_request (titled “Exercism”)
  3. https://en.wikipedia.org/wiki/Exercism:_Get_mentoring_on_Zebra_Puzzle (titled “Exercism: Get mentoring on Zebra Puzzle - Wikipedia”)

(The third tab is newly-created for testing purposes.)

Open the address bar and start searching in open tabs by typing the percent sign (%) followed by word(s). Search for the words “exercism”, “zebra”, and “mentor”.

Actual results:

If I type “exercism” into the address bar, only the first tab is found.
If I type either “zebra” or “mentor”, no tabs at all are found!

It is IMPOSSIBLE to find tabs 2 and 3 via the “Search open tabs” feature!
My suspicion is that the bug is caused by a specific combination of letters or words in the URLs or titles of tabs 2 and 3.

Expected results:

Searching for “exercism” should show all three tabs.
Searching for either “zebra” or “mentor” should find the second and third tabs.

Tabs 2 and 3 should be findable, just like the hundreds of other tabs I have!

Component: Untriaged → Search
OS: Unspecified → macOS
Hardware: Unspecified → Desktop
Hardware: Desktop → ARM64
Component: Search → Address Bar

Thanks for filing this bug.

Marco, a question about switch to tab, maybe you know. I can reproduce comment 0 except I can't load the second URL since I don't have an account at that site. I can reproduce the problem with the Wikipedia URL. I debugged it, and the Wikipedia problem is due to a combination of these two factors:

  1. The STT query excludes pages that are in moz_places
  2. The default Places query excludes pages with zero frecency

Once you load the Wikipedia URL in comment 0, it's in moz_places but its frecency is zero, so we never show it as a STT. (I didn't look into why the frecency is zero since that's expected to happen for some URLs.) I presume the same problem applies to the second URL in comment 0, I don't know.

The second factor makes sense and it's what we've always done, and it's expected that some URLs will end up with zero frecency. But to me, the first factor doesn't make sense, but I don't remember the reason for it, or maybe I never knew it to begin with. Maybe it's left over from UnifiedComplete? Or it's due to a limitation later in the code path with de-duping results?

In any case, this seems like a clear-cut bug that shouldn't happen.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mak)
Priority: -- → P3

(In reply to Drew Willcoxon :adw from comment #1)

Thanks for filing this bug.

Marco, a question about switch to tab, maybe you know. I can reproduce comment 0 except I can't load the second URL since I don't have an account at that site. I can reproduce the problem with the Wikipedia URL. I debugged it, and the Wikipedia problem is due to a combination of these two factors:

  1. The STT query excludes pages that are in moz_places
  2. The default Places query excludes pages with zero frecency

Once you load the Wikipedia URL in comment 0, it's in moz_places but its frecency is zero, so we never show it as a STT. (I didn't look into why the frecency is zero since that's expected to happen for some URLs.) I presume the same problem applies to the second URL in comment 0, I don't know.

The second factor makes sense and it's what we've always done, and it's expected that some URLs will end up with zero frecency. But to me, the first factor doesn't make sense, but I don't remember the reason for it, or maybe I never knew it to begin with. Maybe it's left over from UnifiedComplete? Or it's due to a limitation later in the code path with de-duping results?

In any case, this seems like a clear-cut bug that shouldn't happen.

Observations from my browser history:

  1. The Exercism mentoring tab actually has a frecency (in German: Meistbesucht) of 0, as you suggested.
  2. However, the Wikipedia testing tab has a frecency of 1 and still doesn’t show up when searching open tabs!

(In reply to Drew Willcoxon :adw from comment #1)

  1. The STT query excludes pages that are in moz_places
  2. The default Places query excludes pages with zero frecency

Certain URLs cannot be stored in places (History.canAdd returns false), or the user may be in permanent pb mode, then the first query will still match open pages, as it should. If the url is in history then it is supposedly returned by the Places provider using frecency order (things that are not in history don't have a frecency).
I suspect the first query could be avoided and the UrlbarOpenTabs provider could just fetch all matching tabs in pb mode or for which History.canAdd returns zero... that would not help with this bug though.
We could also evaluate to just make open tabs their own group and not merge them based on frecency. Though it's a more complicate outcome to evaluate.

Once you load the Wikipedia URL in comment 0, it's in moz_places but its frecency is zero, so we never show it as a STT. (I didn't look into why the frecency is zero since that's expected to happen for some URLs.) I presume the same problem applies to the second URL in comment 0, I don't know.

I can reproduce this, frecency is zero and recalc fields are also set to 0. I see one visit to this URL with visit_type 1. Something's wrong here.
the DEFAULT for the frecency field is -1, thus 0 has been inserted.
I must check with the debugger to see why we end up there.

Debugging I could confirm that https://en.wikipedia.org/wiki/Exercism:_Get_mentoring_on_Zebra_Puzzle is actually causing an error 404, then wikipedia has this nice not found handling, where it will provide possible better matches in a normally looking page.
Being a NOT FOUND 404 resolution, we give it frecency = 0, because we don't want to rank it up.

The https://exercism.org/tracks/python/exercises/zebra-puzzle/mentor_request link is also a 500 ERROR for me, I logged it. I think it falls under the same assumption as the 404 error, it would also generate a zero frecency.

I have no idea how the wikipedia page would generate a frecency of 1 but it should show up then, thus I can't explain the facts in comment 2. Though the screenshot seems to show the visit_count in the Library window? That's not the same thing as frecency that is only visible opening the database with an external tool.

Having zero frecency normally (for most providers I can find) just means we won't use the history title, and unless we get a valid (not error) visit it will stay at frecency = 0.
The Places provider though decided to excluded urls with zero frecency.

I think originally the frecency filter was to avoid returning internal urls like place: ones, then we started using it for pages with no history and no bookmarks (kind of orphans), and pages with only error visits. I think it makes sense we don't show users invalid results.

We could and should likely ignore the frecency = 0 filter when openCount is > 0.
That should also be easily testable.

Assignee: nobody → mak
Status: NEW → ASSIGNED
Flags: needinfo?(mak)
Summary: “Search open tabs” feature doesn’t find some specific tabs → “Search open tabs” feature doesn’t find ERROR pages
Whiteboard: [sng]

Debugging I could confirm that https://en.wikipedia.org/wiki/Exercism:_Get_mentoring_on_Zebra_Puzzle is actually causing an error 404, then wikipedia has this nice not found handling, where it will provide possible better matches in a normally looking page.
Being a NOT FOUND 404 resolution, we give it frecency = 0, because we don't want to rank it up.

I did this trying to have a tab with a webpage that has a user-defined tab title. Do you have any suggestions to accomplish this? I’m thinking of a URL like https://mycustomtabtitle.io/?title=Exercism:%20Get%20mentoring%20on%20Zebra%20Puzzle) having ?titleparameter as HTML <title> element. Oh wait a moment, search engines do this! However, I’m still curious whether there is a service that is just for that single thing.

The https://exercism.org/tracks/python/exercises/zebra-puzzle/mentor_request link is also a 500 ERROR for me, I logged it. I think it falls under the same assumption as the 404 error, it would also generate a zero frecency.

Likely an error on Exercism’s part: HTTP 500 doesn’t make sense for this URL, only HTTP 200 if logged in and HTTP 401 otherwise. I might soon file an issue for the Exercism website repository …

I have no idea how the wikipedia page would generate a frecency of 1 but it should show up then, thus I can't explain the facts in comment 2. Though the screenshot seems to show the visit_count in the Library window? That's not the same thing as frecency that is only visible opening the database with an external tool.

I learned something new today! Yes, the screenshots show visit_count, not frecency.

I think originally the frecency filter was to avoid returning internal urls like place: ones, then we started using it for pages with no history and no bookmarks (kind of orphans), and pages with only error visits. I think it makes sense we don't show users invalid results.

Suggestions:

  • Add support for a double percent sign notation %% which also searches in zero-frecency tabs.
  • Or add a setting (maybe a hidden about:config one) to include zero-frecency results in address bar searches.

We could and should likely ignore the frecency = 0 filter when openCount is > 0.

Or do that.

Attachment #9446237 - Attachment description: Screenshot of Exercism mentoring tab with frecency 0 → Screenshot of Exercism mentoring tab with visit count 0
Attachment #9446238 - Attachment description: Screenshot of Wikipedia testing tab with frecency 1 → Screenshot of Wikipedia testing tab with visit count 1

(In reply to green-coder from comment #7)

Debugging I could confirm that https://en.wikipedia.org/wiki/Exercism:_Get_mentoring_on_Zebra_Puzzle is actually causing an error 404, then wikipedia has this nice not found handling, where it will provide possible better matches in a normally looking page.
Being a NOT FOUND 404 resolution, we give it frecency = 0, because we don't want to rank it up.

I did this trying to have a tab with a webpage that has a user-defined tab title. Do you have any suggestions to accomplish this?

I'm sorry, but I'm not sure I understand what you're trying to achieve. it's totally possible to handle error pages like wikipedia, using options in .htaccess or equivalent configuration file. You can also open an about:blank page and then inject html (including a <title>) into it, and have it open as a popup as well as a new tab. Though again I'm not sure what's your goal. It may be a bit off-topic, anyway.

Suggestions:

  • Add support for a double percent sign notation %% which also searches in zero-frecency tabs.
  • Or add a setting (maybe a hidden about:config one) to include zero-frecency results in address bar searches.

we should be showing open tabs even if they are not found, our intent was to hide normal history results, not tabs.

Attachment #9459852 - Attachment description: Bug 1939597 - Search open tabs feature doesn’t find ERROR pages. r=adw → Bug 1939597 - Search open tabs feature doesn't find ERROR pages. r=adw

(In reply to Marco Bonardo [:mak] from comment #8)

(In reply to green-coder from comment #7)

Debugging I could confirm that https://en.wikipedia.org/wiki/Exercism:_Get_mentoring_on_Zebra_Puzzle is actually causing an error 404, then wikipedia has this nice not found handling, where it will provide possible better matches in a normally looking page.
Being a NOT FOUND 404 resolution, we give it frecency = 0, because we don't want to rank it up.

I did this trying to have a tab with a webpage that has a user-defined tab title. Do you have any suggestions to accomplish this?

I'm sorry, but I'm not sure I understand what you're trying to achieve. it's totally possible to handle error pages like wikipedia, using options in .htaccess or equivalent configuration file. You can also open an about:blank page and then inject html (including a <title>) into it, and have it open as a popup as well as a new tab. Though again I'm not sure what's your goal. It may be a bit off-topic, anyway.

My goal is switching to the tab with the custom title which is located next to a tab that is not found by the “search open tabs” feature. This allows me to find the not-found tab by first switching to a tab with a custom title and barely any content in it, to then click on the actually relevant tab next to it.

Fixing this bug removes my need for the aforementioned process.

I see, we're aiming at fixing the bug in Firefox 136.

Pushed by mak77@bonardo.net: https://hg.mozilla.org/integration/autoland/rev/a9c11f603a01 Search open tabs feature doesn't find ERROR pages. r=adw,urlbar-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: