Skip to content

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

Closed

Description

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

[Feature] Link EditingLink components (LinkControl, URLInput) and integrations (RichText link formatting)[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions