Methodician / CoSourcery

1 stars 0 forks source link

CKEditor On Changes body image upload bug #169

Open Methodician opened 5 years ago

Methodician commented 5 years ago

So far in testing I see this every time the final change is an image upload. It looks like onCKEditorChagned runs and articleEditForm.patchValue() is called before the new image tag is fully generated, leaving some junk at the end of the body HTML string.

Methodician commented 5 years ago

Digging in, it looks like some closure is being created, isolating the scope of the saveChanges method. Elsewhere in the component the form.body is in the "local" scope, but in the saveChanges, it's in a "closure" scope and that closure is not updated when the last operation was an image being uploaded. It is when the last operation was a character change.

Methodician commented 5 years ago

I just tested after the new body image tracking system and this may be resolved. Further testing is needed. @mkrabacher can you still re-produce the issue? I'm guessing that the processing we're doing with the body images object on the form itself is forcing the articleForm inside that closure to update as well. It might still be good to knock that closure out anyway since it doesn't seem helpful.

mkrabacher commented 5 years ago

Yea it seems to be working way better. The only way I can get it to reproduce is if you add an image and immediately save and refresh, maybe it'd be good if you were stopped from saving until the image is processed? Otherwise you get second save changes that pops up, even if not editing, if you save immediately after adding a photo.