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

Rohit1 ckeditor4 load eventlistener leak fix #4272

Merged

Conversation

rohit1
Copy link
Contributor

@rohit1 rohit1 commented Sep 14, 2020

What is the purpose of this pull request?

Does your PR contain necessary tests?

All patches that change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

Did you follow the CKEditor 4 code style guide?

Your code should follow the guidelines from the CKEditor 4 code style guide which helps keep the entire codebase consistent.

  • PR is consistent with the code style guide

What is the proposed changelog entry for this pull request?

* [#<ISSUE_NUMBER>](https://github.com/ckeditor/ckeditor4/issues/<ISSUE_NUMBER>): Describe the purpose of the pull request in a few simple sentences.

What changes did you make?

added removeEventListener() in onReady callback function

Which issues does your PR resolve?

Closes #4273.

f1ames
f1ames previously requested changes Sep 15, 2020
Copy link
Contributor

@f1ames f1ames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution @rohit1!

Your pull request is missing tests, see our Contributing Code guide for more details.

I think unit tests would be enough here. If you will have any problems writing them, just feel free to reach out so we can assist or take over this PR.

@github-actions
Copy link

It's been a while since we last heard from you. We are marking this pull request as stale due to inactivity. Please provide the requested feedback or the pull request will be closed after next 7 days.

@github-actions github-actions bot added the pr:stale 🗿 Old PR stale label. Currently "stale" label is used to mark both stale issues and PRs. label Sep 23, 2020
@f1ames
Copy link
Contributor

f1ames commented Sep 23, 2020

Ok, taking over this PR to add tests.

@f1ames f1ames force-pushed the rohit1-ckeditor4-load-eventlistener-leak-fix branch from 7d13d16 to f753d59 Compare September 23, 2020 12:00
@f1ames f1ames changed the base branch from major to master September 23, 2020 12:01
@f1ames
Copy link
Contributor

f1ames commented Sep 23, 2020

Rebased and retargeted onto latest master.

@f1ames
Copy link
Contributor

f1ames commented Sep 23, 2020

Unfortunately, changes in ckeditor_base.js requires special caution due to some convoluted way in which fixes should be applied there, specifically:

// #### Compressed Code
// Compressed code in ckeditor.js must be be updated on changes in the script.
// The Closure Compiler online service should be used when updating this manually:
// http://closure-compiler.appspot.com/
// #### Raw code
// ATTENTION: read the above "Compressed Code" notes when changing this code.

So apart from changes in this file, the changes then needs to be compressed and moved to ckeditor.js... 😬 Fortunately, the closure compiler linked there is still online (probably could be replaced with other tool). Not sure if it works the same as some time ago, OTOH it shouldn't hopefully break anything.

@f1ames f1ames self-assigned this Sep 23, 2020
@f1ames
Copy link
Contributor

f1ames commented Sep 24, 2020

Ok, I have to ignore unit tests on IE8 due to sinon stubbing issue (see this commit cfc5283). Also IE8 is ignored outside of bender.test which seems to be working fine (apart from return which is added to prevent further code execution), but I assume it's not correct use... However, it simplifies tests (due to different methods for listeners attaching in IE8).

@f1ames f1ames removed their assignment Sep 24, 2020
@f1ames
Copy link
Contributor

f1ames commented Sep 24, 2020

All tests in IE8 are also green so I guess nothing exploded 😅

@Comandeer Comandeer self-requested a review September 29, 2020 14:08
@Comandeer Comandeer self-assigned this Sep 29, 2020
@Comandeer Comandeer force-pushed the rohit1-ckeditor4-load-eventlistener-leak-fix branch from cfc5283 to f13fa4b Compare September 29, 2020 15:35
Copy link
Member

@Comandeer Comandeer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Comandeer Comandeer merged commit 1704510 into ckeditor:master Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:stale 🗿 Old PR stale label. Currently "stale" label is used to mark both stale issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ckEditor editor.js leaking 'load' eventListener attached to the window object
3 participants