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

Search for posts when adding links is potentially VERY slow #26358

Closed
omkohmann opened this issue Oct 21, 2020 · 2 comments · Fixed by #26529
Closed

Search for posts when adding links is potentially VERY slow #26358

omkohmann opened this issue Oct 21, 2020 · 2 comments · Fixed by #26529
Assignees
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@omkohmann
Copy link

Describe the bug
When you want to add a link to your paragraph block, you will open a small modal where you can search for a post on your site. This searchbox adds a ajax query for every onKeyUp resulting in as many queries as the amount of letters in your search. Since the result will not show until all are finished, this can take a very long time(Especially when there are a lot of posts on your site. 45.000 posts resulted in a search that took well over 30 seconds)

To reproduce
Steps to reproduce the behavior:

  1. Add a paragraph block
  2. click on Link icon
  3. Compose a search for posts with many letters
  4. Inspect in debugger under network(in chrome) and notice that there are as many queries as there are letters written in the search field

Expected behavior
ajax calls that are no longer valid should be aborted when a new one is being called.

Editor version (please complete the following information):

  • WordPress version: 5.5.1
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? default

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version 86.0.4240.75
@talldan talldan added [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Bug An existing feature does not function as intended labels Oct 22, 2020
@talldan
Copy link
Contributor

talldan commented Oct 22, 2020

I marked #26374 as a duplicate.

We probably want to 'debounce' when a user is typing, so the requests are only made when there's a reasonable pause. That should have already been the case, but maybe it became broken for some reason.

@mtias
Copy link
Member

mtias commented Oct 23, 2020

I run into this as well recently. It used to work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants