I'd return to the post with the new image.
All post content was wiped.
Chrome 75 on macOS
Accidentally came upon whilst writing a post. :)
Another report #2162007-zen
I think this is quite serious bug - as it basically deletes the content user created prior. It's a disaster if the post hasn't been autosaved.
Another case: #13648781-hc
I agree with Ivan... this is a pretty serious issue.
I'm wondering how often this is the actual culprit when we have a user contact us about their post content mysteriously going missing?
With this particular user, if I hadn't already been aware of this issue, I never would have thought to even ask the question of "did you happen to insert and edit image right before the content went missing?" (and the answer was yes).
This is a video that shows how the image itself won't insert after editing it:
https://monosnap.com/file/Uvl17d7Q5QKdeqRUxv6EhD0cZusn0H
And this video demonstrates how the content goes missing if you add/edit an image before an autosave/save has been performed:
Have also confirmed that it doesn't happen in wp-admin because the interface is different. When you're inserting images through wp-admin the edit button is on the right and opens in a new window rather than in the iframe.
Have been able to replicate this on a local calypso dev instance using the above steps.
Additional notes:
Insert
I had another report in 2174695-zd. I had actually opened a new bug report about it here, but closed it after being notified of this one. My old report:
After a bit more debugging I have narrowed down the issue to the loading of the Edit Image dialog. The post content is actually wiped as soon as the Edit Image dialog is opened, not on the clicking of the Insert button.
Opening the Edit image dialog causes two re-renders of the CalypsoifyIframe component - on the second re-render the editor content is wiped. For some reason this.prop.shouldLoadIframe gets set to false during one of the re-renders which causes the content loss - forcing shouldLoadIframe to always be true prevents the data loss - will try and work out why this is being set to false in the instance of the edit image modal tomorrow, unless someone else has time to pick this up in the mean time.
So the exact cause of the issues is that at https://github.com/Automattic/wp-calypso/blob/master/client/gutenberg/editor/calypsoify-iframe.tsx#L575 isRequestingSite( state, siteId )
returns true when the image edit dialog loads, which sets shouldLoadIframe
to false, and this causes a reload of the iframe and the loss of content.
Now just need to work out how to stop this happening.
Just had a user report this problem to us at 10118046-hc. They said the problem started about two weeks ago.
I've offered to follow up with them when this is fixed.
Just pushed an update to production which should fix this issue in both WP.com Simple Sites and JetPack sites.
Most helpful comment
Just pushed an update to production which should fix this issue in both WP.com Simple Sites and JetPack sites.