-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
BUGFIX: Change update interval on CKEditor #3751
BUGFIX: Change update interval on CKEditor #3751
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Alvadda,
thanks for taking care of this!
I've pointed out one leftover console.log
in the comments.
Additionally, could you please take a look at this test:
neos-ui/Tests/IntegrationTests/Fixtures/1Dimension/createNewNodes.e2e.js
Lines 178 to 195 in 2c409b5
subSection('Inline validation'); | |
// We have to wait for ajax requests to be triggered, since they are debounced for 0.5s | |
await t.wait(600); | |
await changeRequestLogger.clear(); | |
await t | |
.expect(Selector('.test-headline h1').exists).ok('Validation tooltip appeared') | |
.click('.test-headline h1') | |
.pressKey('ctrl+a delete') | |
.switchToMainWindow() | |
.wait(600) | |
.expect(ReactSelector('InlineValidationTooltips').exists).ok('Validation tooltip appeared'); | |
await t | |
.expect(changeRequestLogger.count(() => true)).eql(0, 'No requests were fired with invalid state'); | |
await t | |
.switchToIframe(contentIframeSelector) | |
.typeText(Selector('.test-headline h1'), 'Some text') | |
.wait(600); | |
await t.expect(changeRequestLogger.count(() => true)).eql(1, 'Request fired when field became valid'); |
If you change the wait times that are currently set at 600
to 1600
, the E2E tests will turn green :)
Co-authored-by: Wilhelm Behncke <2522299+grebaldi@users.noreply.github.com>
I've altered the wait times in the E2E tests, and they're green now 🎉 I'm gonna merge this :) |
Currently, the CKEditor send the onChange event after user stops typing for 500ms, this results in a lot of unnecessary events that bloats the server.
This adjustment was initially made in response to a new server behavior observed in Neos9, where the server temporarily blocks incoming change requests during publishing processes. Extending the debounce interval aims to mitigate the risk of overlap between change requests and publishing operations.
What I did
The debounce timer has been extended from 500ms to 1500ms. This reduces the frequency of onChange events, thereby decreasing server load.
An additional onChange event has been introduced to trigger whenever the editor loses focus. This ensures that all changes are captured, even if the user does not pause in their typing.
How to verify it
Engage with the CKEditor by typing. Upon ceasing typing, observe that the publish button (located in the top right corner) indicates a change was made, after a delay of 1500ms.
While typing in CKEditor, shift focus to another element before the 1500ms debounce period concludes. The publish button should still update to reflect a change, ensuring that all modifications are captured accurately.