Skip to content

Commit 298c25f

Browse files
committed
rustdoc search: fix cache invalidation error
ever since #129430, two queries with an identical userQuery can have different results. fixed by caching on the original query, not the case folded version.
1 parent 3259007 commit 298c25f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/html/static/js/search.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3588,7 +3588,7 @@ async function showResults(results, go_to_first, filterCrates) {
35883588
results.query = DocSearch.parseQuery(searchState.input.value);
35893589
}
35903590

3591-
currentResults = results.query.userQuery;
3591+
currentResults = results.query.original;
35923592

35933593
const [ret_others, ret_in_args, ret_returned] = await Promise.all([
35943594
addTab(results.others, results.query, true),
@@ -3719,7 +3719,7 @@ async function search(forced) {
37193719
const query = DocSearch.parseQuery(searchState.input.value.trim());
37203720
let filterCrates = getFilterCrates();
37213721

3722-
if (!forced && query.userQuery === currentResults) {
3722+
if (!forced && query.original === currentResults) {
37233723
if (query.userQuery.length > 0) {
37243724
putBackSearch();
37253725
}

0 commit comments

Comments
 (0)