Skip to content

disable plugin update-input-on-change - #2

Open
konnektor3000 wants to merge 3 commits into
Combodo:masterfrom
konnektor3000:avoid-editor-slowdown
Open

disable plugin update-input-on-change#2
konnektor3000 wants to merge 3 commits into
Combodo:masterfrom
konnektor3000:avoid-editor-slowdown

Conversation

@konnektor3000

Copy link
Copy Markdown

Base information

Question Answer
Related to a SourceForge thead / Another PR / Combodo ticket? no
Type of change? Bug fix

Symptom (bug) / Objective (enhancement)

CKEditor gets very slow when typing when there are more than approximately 70'000 characters in html source. This amount of formatted text is easily reached when documentations or FAQs are written.

Reproduction procedure (bug)

  1. On iTop 3.2.0
  2. Edit a HTML formatted field in any class
  3. Fill in content that results in more than approximately 70'000 characters in html source. Please see example: https://gist.github.com/konnektor3000/ab8ae6694d14e7b24f4aea20f1187448
  4. Continue typing
  5. Editor hangs after each keystroke

Cause (bug)

This happens because on every keystroke the field's content is processed by the plugin update-input-on-change. Actually I'm not sure if this plugin is necessary at all. I observed no disadvantages after disabling this plugin.

Proposed solution (bug and enhancement)

Remove plugin update-input-on-change if possible.

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have tested all changes I made on an iTop instance (tested locally in javascript, not in type script)
  • Would a unit test be relevant and have I added it?
  • Is the PR clear and detailed enough so anyone can understand digging in the code?

Checklist of things to do before PR is ready to merge

  • run npm run build
  • discuss impact of removing that plugin
  • remove plugin at all, not only disable it

@steffunky

Copy link
Copy Markdown
Member

Hi @konnektor3000, thanks for your PR!

In your descriptions, you say that it's update-input-on-change that slows down the editor, but in your PR you commented trigger-update-on-ready which one is it?

If this is indeed update-input-on-change, we can't remove it as it updates the underlying input with the ckeditor data, and that input is used to calculate dependent fields, mandatory value, must change value and is the one that is submitted with the form.

This plugin could be improved if it causes performance issue, either use less costly methods inside it(editor.getData() seems to be costly), only call if if there are been no keystroke in the last X seconds

@jf-cbd jf-cbd moved this from First review needed to Pending contributor update in Combodo PRs dashboard Apr 25, 2025
@konnektor3000
konnektor3000 force-pushed the avoid-editor-slowdown branch from 8048356 to 491255c Compare May 15, 2025 08:08
@konnektor3000

Copy link
Copy Markdown
Author

Hello Stephen,
I added a debounce to UpdateInputOnChange instead of disabling it completely. I also tested in my test environment. Please review my changes.

@steffunky

Copy link
Copy Markdown
Member

Hi, thanks for the update!
We logged this issue under N°8340, I'll try to test and validate your PR this week

@steffunky

Copy link
Copy Markdown
Member

It works like a charm!
Could you mark this PR as ready for review so we can merge it?

@konnektor3000
konnektor3000 marked this pull request as ready for review June 2, 2025 09:11
@bdalsass
bdalsass self-requested a review July 10, 2025 06:49
bdalsass added a commit that referenced this pull request Jul 10, 2025
(from konnektor3000 pull request #2)
@bdalsass

Copy link
Copy Markdown
Contributor

Hi @konnektor3000, we have just successfully merged your branch inside our repository.
We have fixed merge conflicts (build files) from our master branch with squash merge option.
The PR still in merge conflict (maybe dur to squash) and i can't find a way to mark it as merged !

Thanks for your helpful contribution 😃 !
I you want a contributor badge, please send me an email with your postal information, we will send you it with pleasure.

@bdalsass

bdalsass commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

The email for badge request 🙄community@combodo.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending contributor update

Development

Successfully merging this pull request may close these issues.

4 participants