You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is basically the same thing as WordPress/gutenberg#17395 and WordPress/gutenberg#24679, and I was wondering why I kept encountering the issue on my personal blog, where Firefox (tested on version 94, but it happened with any version, for years) would always warn me like this when I try to navigate away from the blog post editor, even if I just clicked the "Save draft" (or "Update post") button 2 seconds ago, or even if I enter an already published post and do not touch anything before trying to exit it:
To reproduce, with the SubLanguage plugin active:
Enter editing mode for a blog post
Wait for the Gutenberg editor to fully load
Click the "W" wordpress logo on the top left to try to exit the editor and to go back to the posts list
The text was updated successfully, but these errors were encountered:
Hello, thanks for reporting.
This is appening because sublanguage is running a script that periodically set a variable corresponding to the language being edited. As Gutenberg synchronize this variable after every save, it needs to be constantly set by a timer function. This is causing the editor to be permanently dirty. A much better alternative would be to run a function to set this variable once just before Gutenberg saves stuffs, but as stupid as it may sounds, I still did not find out how to do that :(
Maybe you could git grep gutenberg's code to find out the saving-related code, see what happens in there, if maybe it fires off a signal/event/something that you could connect to? Just wildly guessing, I have no idea how any of this works :)
Actually, maybe function PostSavedState is where it's happening at. Again, just guessing, purely by luck from the fact that I happened to be looking at the diff in WordPress/gutenberg#38776
This is basically the same thing as WordPress/gutenberg#17395 and WordPress/gutenberg#24679, and I was wondering why I kept encountering the issue on my personal blog, where Firefox (tested on version 94, but it happened with any version, for years) would always warn me like this when I try to navigate away from the blog post editor, even if I just clicked the "Save draft" (or "Update post") button 2 seconds ago, or even if I enter an already published post and do not touch anything before trying to exit it:
To reproduce, with the SubLanguage plugin active:
The text was updated successfully, but these errors were encountered: