Skip to content

Editor crashes when the content of a synced pattern is updated #6703

@fluiddot

Description

@fluiddot

Describe the bug

Note

Synced patterns (formerly named Reusable blocks) are only available on WPCOM sites.

In the mobile native version, we only cover the functionality of rendering the synced pattern. We don't support yet editing the content. However, its content might change locally due to side effects triggered during rendering.

As an example, having an Image block with a URL that doesn't contain the query parameter w (width) leads to an update. In this case, the Image block sets the width based on the size attribute and updates the URL. This update makes the editor crash with the error undefined is not a function.

To Reproduce

Preparation:

  1. On a web browser, navigate to the patterns page.
  2. Select the WP.com site for testing.
  3. Click on "Add new pattern".
  4. Add a title.
  5. Add an Image block.
  6. Edit the HTML of the Image block and remove the query parameters from the image source (e.g. ?w=1024).
  7. Publish it.

Steps:

  1. Create a post.
  2. Tap on ➕ button.
  3. Tap on "Synced patterns" tab.
  4. Tap the item created in the preparation section.
  5. Observe that the editor crashes.

Expected behavior
The editor shouldn't crash when using synced patterns.

Screenshots

Smartphone (please complete the following information):

  • Device: iPhone 11
  • OS: iOS 17.0.2
  • Version 24.4

Additional context
N/A

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