janboddez / share-on-mastodon

Easily share WordPress posts on Mastodon.
https://jan.boddez.net/wordpress/share-on-mastodon
GNU General Public License v3.0
39 stars 5 forks source link

"Disable checkbox" Gutenberg edge case? #76

Closed janboddez closed 1 year ago

janboddez commented 1 year ago

If the checkbox was previously enabled, and the post was, e.g., saved as draft (at which point two requests are fired, the 2nd of which updates the post meta), and it is then disabled just before the post is being published, the post meta will still be "true" (during the 1st of the new two, "publish," requests) and the post will very likely get shared (after which the post meta will get updated to "false," yes).

We "work around" this only (to prevent other, uh, unknown unkowns) when "custom message" is active (because if we did not, it wouldn't get saved before sharing) but maybe we should always apply the workaround in order to prevent the situation described above.