Skip to content
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

Prevent Search Index Conflicts Across Multiple Tabs in Docsify Search Plugin in v5? #2533

Closed
1 task done
paulhibbitts opened this issue Feb 8, 2025 · 2 comments
Closed
1 task done

Comments

@paulhibbitts
Copy link
Collaborator

paulhibbitts commented Feb 8, 2025

Bug Report

Steps to reproduce

  1. Open two Docsify sites in two Browser tabs where both use the Search plugin.
  2. Search one site for some expected words
  3. Then switch to the second site and search for the same words

Current behaviour

The first site open will be indexed and stored in the local(?) database, and the second site will try to use these same items for it's search

Expected behaviour

Multiple Docsify sites open in multiple tabs should each be searchable with the expected content

Other relevant information

  • Docsify version: v5
  • Bug still occurs when all/other plugins are disabled?

  • Docsify plugins (if the bug happens when plugins enabled, please try to isolate the issue):

Please create a reproducible sandbox

Here are two sandboxes, with different content and both using the Search plugin:

Demo site 1:
https://yskwll.csb.app/#/

Demo site 2:
https://5m8xyx.csb.app/#/

Please let me know if more info is helpful, and if I can be of help testing etc. Thank you!

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

@sy-records
Copy link
Member

Try setting namespace?

Image

@paulhibbitts
Copy link
Collaborator Author

Oh that is so excellent @sy-records to know! I should have seen that myself though 🙂

I've updated the test CodeSandboxes and it works like a charm. In my case I've got folks creating multiple docsify projects from a single Starter Kit so to further avoid conflicts it looks like namespace: 'docsify-open-course-starter-kit' + Date.now(), works as a way to do this automatically.

Thanks again @sy-records !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants