Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing Post Meta triggers multi-entity save flow and duplicate site editor save request #63355

Closed
lgladdy opened this issue Jul 10, 2024 · 4 comments
Labels
[Type] Bug An existing feature does not function as intended

Comments

@lgladdy
Copy link

lgladdy commented Jul 10, 2024

Description

In WordPress 6.6 RC3 (although, I replicated this on beta1 as well), editing an ACF Block is triggering the multi-entity save flow in the site editor when editing a post.

This triggers a notification that something is changing about the site (when actually, it's just in the post being edited) and accepting the save triggers two duplicate POST requests to update the post. One of which completes with Site Updated and one with Post Updated notifications in editor.

Step-by-step reproduction instructions

My reproduction steps are with ACF Blocks, but our blocks only update the block comment within our data attribute on edit, we also trigger wp.data.dispatch('core/editor').editPost({ meta: { _acf_changed: 1 } }); whenever an ACF field is changed so we can do some tracking for revisions. My guess is it's this call that is triggering Gutenberg to believe a site change has happened, show the multi-entity save panel and then duplicate the POST request to actually save.

Screenshots, screen recording, code snippet

https://youtu.be/X7fR-xrKIQE (sorry about the mono audio)

Environment info

WordPress 6.6 RC3
Chrome and Safari latest

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

No

@lgladdy lgladdy added the [Type] Bug An existing feature does not function as intended label Jul 10, 2024
@lgladdy
Copy link
Author

lgladdy commented Jul 10, 2024

A Making WordPress slack discussion on this bug is here: https://wordpress.slack.com/archives/C02QB2JS7/p1720616434101469

@lgladdy
Copy link
Author

lgladdy commented Jul 10, 2024

A second bug exists in this flow as well.

If a post is locked using wp.data.dispatch( 'core/editor' ).lockPostSaving( 'test' ); - the save button is disabled as expected, but you can still click it to bring up the multi-entity save panel, and it will still submit the POST request which triggered Site Updated - although, the Post Updated call doesn't take place.

@SantosGuillamot
Copy link
Contributor

SantosGuillamot commented Jul 11, 2024

I've opened this pull request to revert the changes that caused both issues.

@lgladdy
Copy link
Author

lgladdy commented Jul 11, 2024

Resolved by #63412.

We're tracking what happens next in #63425 here.

@lgladdy lgladdy closed this as completed Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
2 participants