Opened 14 years ago
Closed 12 years ago
#6504 closed Bug (fixed)
Race condition while loading several customConfig files
Reported by: | Alfonso Martínez de Lizarrondo | Owned by: | Frederico Caldeira Knabben |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 4.1.2 |
Component: | General | Version: | |
Keywords: | Cc: | k@…, glen.84@…, jean-francois.fournier@… |
Description
Reported in http://cksource.com/forums/viewtopic.php?f=11&t=20480
The problem is that if several different customConfig files are used, there's a risk that the load event for each one of them are not done synchronously: it fires for the first script, but it happens that the second one has also been loaded, and so it overwrites the CKEDITOR.editorConfig function and the first editor instance uses the config data of the second editor.
For me the solution is to create a queue of scripts that can't be loaded in parallel.
Attached simplified testcase (it fails most of the time in IE and sometimes in Firefox, other browsers might exhibit similar behaviors) and proposed solution.
Attachments (3)
Change History (21)
Changed 14 years ago by
Attachment: | testcase 6504.zip added |
---|
comment:1 Changed 14 years ago by
Status: | new → review |
---|
comment:2 Changed 12 years ago by
I have got this problem as well. Sadly, the patch does not apply for the current version. Please fix this!
comment:4 Changed 12 years ago by
Do you mean that this is important for you and in these three months you just have been waiting for someone else to update the patch?
comment:5 Changed 12 years ago by
Don't be rude, and I have to apologize if I sounded rude. Sadly I don't have the js skills to fix this myself. I'm a contributor to php open source projects, but in case of this js project my contribution is giving feedback on issues like that. Let me know if I can do anything to help. Recherche, whatever.
It's quite common to have more than one ckeditor on one page. So I'm surely not the only one experiencing that issue.
Changed 12 years ago by
Attachment: | 6504_1.patch added |
---|
comment:6 Changed 12 years ago by
Status: | review → review_failed |
---|
I have updated the patch (or I only think i have) but it doesn't seem to work with current version of editor 3.6.5.
Sample scriptRace has failed in Firefox and IE every time I have tried it.
comment:7 Changed 12 years ago by
I've similar problem. I've also applied the patches manually. The result is that the .queue command is called and the queue itself is full, but CKEDITOR.scriptLoader.advanceQueue() never gets called, thus no config loaded (for me) or may be I'm putting it in the wrong place?
comment:8 Changed 12 years ago by
Cc: | glen.84@… added |
---|
Just adding myself to CC, as I have the same issue.
I had to write something here, otherwise I get:
"Submission rejected as potential spam (Akismet says content is spam, StopForumSpam says this is spam (username))"
comment:9 Changed 12 years ago by
I wonder if removing this setTimeout would solve the issue. It would be strange if browsers were firing onload in different order than JS is executed.
comment:10 Changed 12 years ago by
#10377 was marked as duplicate.
Please see #10377 for another working test-case. In that ticket situation is a little different as it looks like second editor doesn't get configuration file assigned (TC is different there as config gets called from within another config called by editor)
NOTE: User @jffou17 has provided his fix for CKEditor 4.X in #10377.
comment:12 Changed 12 years ago by
Milestone: | → CKEditor 4.1.2 |
---|
Let's give it a try for the 4.1.2. If it'll be too complex, we may postpone it for the next minor.
comment:13 Changed 12 years ago by
Owner: | changed from Alfonso Martínez de Lizarrondo to Olek Nowodziński |
---|---|
Status: | review_failed → assigned |
comment:14 Changed 12 years ago by
Status: | assigned → review |
---|
Dev
- Created t/6504 branch.
- Implemented
CKEDITOR.scriptLoader.queue
method based on proposed patch. This one is somewhat simpler and gentle.
Tests
- Created t/6504 branch in tests-v4.
- Added mt for this ticket.
- Added tests for
CKEDITOR.scriptLoader.queue
. - Added tests for
customConfig
race.
comment:15 follow-up: 17 Changed 12 years ago by
Owner: | changed from Olek Nowodziński to Frederico Caldeira Knabben |
---|
The proposed fix looks cool, except for the fact that the new queue() method was getting stuck when used more than once.
I've just pushed a fix for this, added by a new test. Other than this I would be ok fot a R+.
comment:17 Changed 12 years ago by
Status: | review → review_passed |
---|
Replying to fredck:
The proposed fix looks cool, except for the fact that the new queue() method was getting stuck when used more than once.
I've just pushed a fix for this, added by a new test. Other than this I would be ok fot a R+.
I'm cool with it.
comment:18 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
Merged fix into master, dev (git:33a7150), tests (55c885d).
testcase