Bug 1579334 Comment 18 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Drew Willcoxon :adw from comment #17)
> It seems like `_addMatch` should stop the search once `maxResults` results are added.

I wrote a patch for this, but test_search_suggestions.js fails because the history query ends up finishing before the search suggestions fetch, and the history query returns enough results to meet `maxResults`, so the search is stopped, *but* there would have been search suggestions with higher frecency than some of the history results.

IOW we can call `_addMatch` more than `maxResults` times, and later calls can add results with higher frecencies than earlier calls, and `_addMatch` takes care to inserts results in order of frecency. Which is right and proper. So that idea is no good.
(In reply to Drew Willcoxon :adw from comment #17)
> It seems like `_addMatch` should stop the search once `maxResults` results are added.

I wrote a patch for this, but test_search_suggestions.js fails because the history query ends up finishing before the search suggestions fetch, and the history query returns enough results to meet `maxResults`, so the search is stopped, *but* there would have been search suggestions with higher frecency than some of the history results.

IOW we can call `_addMatch` more than `maxResults` times, and later calls can add results with higher frecencies than earlier calls, and `_addMatch` takes care to inserts results in order of frecency. Which is right and proper and obvious in hindsight. So that idea is no good.

Back to Bug 1579334 Comment 18