Wordpress-android: Editor: Post contains local changes even when the user doesn't modify the post

Created on 19 Oct 2020  路  9Comments  路  Source: wordpress-mobile/WordPress-Android

Expected behavior

When I open a post in the gutenberg editor and I close it I expect the post won't contain any local changes.

Actual behavior

When I open a post in the gutenebrg editor and I close it the post contains local changes.

Steps to reproduce the behavior

  1. My Site
  2. Blog Posts
  3. Open a published post (eg. this long post) - it happens on some posts only after you click into the content. However, it happens on this post even when I just open it and close it)
  4. Press back
  5. Notice the post contains "Local changes" label
Tested on [device], Android [version], WPAndroid [version]

Emulator API 29

cc @mchowning you recently played with saving/exiting editor
cc @planarvoid you also have context. Would you have time to look into it during groundskeeping?

PostinEditing [Pri] High [Type] Bug

All 9 comments

Looks related to the ticket opened a few days ago in the gb-mobile repo: https://github.com/wordpress-mobile/gutenberg-mobile/issues/2714

Thanks for the info, I've missed that. They look similar, however, I haven't even need to scroll + this issue isn't about autosave but about save on exit. Having said all that there is a pretty high chance these two tickets are related.

Since you're also @mchowning doing groundskeeping this week, is it ok if I'll leave this to you?

@mkevins has noted a similar-sounding issue here:

Another observation [...] is that simply opening and existing the post (without making any changes) and then closing it results in the autosave mechanism kicking in.

I have spent some time investigating this, and it appears to be due to certain blocks having outdated or otherwise unexpected (but valid) formatting in the post content. I (obviously) still need to do some more investigation into this, and I do plan to follow-up on this.

A note which might be useful - I noticed the EditorFragment.getTitleOrContentChanged() is invoked when you open a post. It's also interesting that it is invoked on the same post every time you open it (even if you open it after it already has the "local changes" label).

Removed my assignment because I'm not going to have time to get back to this in the near future.

Raising priority because there is potential data loss if Gutenberg Mobile doesn't return the most up to date content when the EditPostActivity asks for it (noted at https://github.com/wordpress-mobile/WordPress-Android/issues/13003#issuecomment-750106983).

Apologies, I added that last comment to the wrong issue. @malinajirka can you help me with prioritization on this one? Should it stay medium?

Was this page helpful?
0 / 5 - 0 ratings