janboddez/share-on-mastodon

"Disable checkbox" Gutenberg edge case?

Closed this issue · 0 comments

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.