Fix cache timeout for commands
What does this MR do and why?
Fix cache timeout for commands
In rich text editor, in autocomplete_helper, fix memoize function to have a proper cache timeout. This would prevent sending too many calls for commands.
Changelog: fixed
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
Screen Recording 2024-03-28 at 08.00.25.mov | Screen Recording 2024-03-28 at 08.04.18.mov |
Call to commands is sent every keystroke, sometimes even multiple times per keystroke. |
Call to commands is sent only once per 10 seconds. |
How to set up and validate locally
- Type a slash command in any issue in rich text editor and observe the calls sent in the Network tab in developer tools.
- Only one call per 10 seconds should be sent, instead of several calls per keystroke.
Related to #441098 (closed)
Edited by Himanshu Kapoor