зеркало из https://github.com/mozilla/gecko-dev.git
80e0f95944
This was a little more work than I first thought because fixing it uncovered another problem: The recurse logic in the muxer isn't quite right. There are a couple of problems actually: 1. By re-using the results from children that did not fill up, we skip updating `stateCopy` (and therefore `state`), which messes up subsequent buckets in the recursion because they're working with the wrong state. 2. By simply assigning `state = stateCopy` after handling children that didn't fill up, we're not really doing anything because at that point the function is done. The caller and subsequent buckets in the recursion won't see the updated state. We need to update `state` in place. These problems were revealed in test_resultBuckets.js, which is pretty thorough. To fix the actual problem that the bug is about (not deduping remote suggestions and form history), we just need to keep a set of suggestions that the muxer has seen so far, and then `_canAddResult` can discard dupe suggestions. This patch adds `state.suggestions` for that, and it includes form history, remote suggestions, and the heuristic query when it's a search result. This way the relative ordering of form history vs. remote suggestions doesn't matter. We'll dedupe whichever comes later. A bunch of tasks in test_resultBuckets.js needed to be updated to account for this because they were incorrectly not expecting dupes to be removed. Differential Revision: https://phabricator.services.mozilla.com/D106030 |
||
---|---|---|
.. | ||
actors | ||
app | ||
base | ||
branding | ||
components | ||
config | ||
docs | ||
extensions | ||
fonts | ||
fxr | ||
installer | ||
locales | ||
modules | ||
themes | ||
tools/mozscreenshots | ||
.eslintrc.js | ||
LICENSE | ||
Makefile.in | ||
app.mozbuild | ||
build.mk | ||
confvars.sh | ||
defs.mk | ||
l10n-registry.manifest | ||
moz.build | ||
moz.configure |