-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the race condition causing search not to initialize properly #2593
Conversation
As far as the code looks, it just delays the function call by 1 second if the index is Shouldn't we keep looping or something and give a bit more time for the index to load(slow networks/other problems). Then for example after 10 seconds the index doesn't load we could give an alert/console.warn something? |
It does loop. |
Oh, condition based recursion until the index isn't defined. (Is this been tested?) Fair enough, the PR looks good to me. P.S.: Needs a changelog entry though... |
Sometimes the search index takes longer to download than, and the
documenter.js
script already runs, in which case it will error with:and the search UI doesn't work.
This effectively adds a loop with a
sleep
to the search code that will wait until thedocumenterSearchIndex
is actually available, before running any of the search initialization code.