Skip to content

[Android] Gutenberg changes a posts content without informing the UI #2701

@antonis

Description

@antonis

Describe the bug
In some cases Gutenberg seems to change a posts content without informing the UI. This causes an WordPress-Android crash only on DEBUG mode with a log message Post had changes that needed to be saved when exiting the editor, and there was NOT an autosave pending. This means that the editor's autosave mechanism failed. indicating that the autosave mechanism failed.

To Reproduce

This is reproduced consistently with the Layout picker feature. You can use the app from wordpress-mobile/WordPress-Android#13105 (use the wasabi build flavor)

Layout Picker should show when creating a new page from My Site or Site Pages the Modal Layout Picker appears.

Steps to reproduce the behavior:

  1. Run the WPApp in DEBUG mode from the PR above.
  2. In the My Site screen press the Add(+) floating button
  3. Select Site page from the bottom menu
  4. Scroll to the bottom and select the first layout of the Contact pages category
  5. Press the Create page button
  6. Wait for the page to load
  7. Press the back button without editing the page
  8. Notice that the app crashes

Expected behavior
Gutenberg should inform of the changes preventing the app from crashing.

Screenshots

Comparing the post content reveals differences that seem to occur on the Gutenberg side and are not tracked.

The issue also is reproduced consistently with the layout of the Team pages category. With other supported layouts no crash does not seem to occur.

Smartphone:

  • OS: Android

Additional context
Though this seems to occur rarely it might be possible to be reproduced in other cases where the content is set without the user editing it. Such cases are creating posts from the share action, rebloging a post or setting a page layout (as in the reproduction steps above).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions