-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Editor: prompts to restore/discard changes when there are no changes #9833
Comments
Hey @ryanboren thanks for reporting this. I'm trying to recreate the issue using steps 1-4 up top and can't seem to trigger it. To clarify, the <- Back button, is that the browser back button or the <- Back in the sidebar? The flow I'm doing is, visiting |
Okay did some digging on the "Saved Draft" dialog as well. This dialog will be shown if a post has any Both wp-admin, and calypso are quite generous in making these autosaves as well, so even if you have a post open in either, errantly hit the space bar while focused in the editor, an autosave point will be created. Funny how these autosaves are here to create trust in the editor, but can cause confusion as well. That being said, this dialog is persistent. So even if you click "Don't Restore" - the next time you open the same post in the calypso editor, the dialog is shown. The only way to clear out the autosave meta is to perform an update on the post. I'm not sure if "Don't Restore" should clear out the autosave meta, but perhaps a third action should be available here for "Delete Auto Save"? |
@ryanboren Any further thoughts here based on @timmyc's questions? |
I don't think I'm errantly hitting keys--certainly not every time this happens, which is almost daily. For my flow, deleting when I say "Don't Restore" is okay-ish. I can't speak for other flows though. This is un-transparently destructive. Until we have transparency, perhaps "Delete Auto Save" (or "Discard revision"), but then I'll be wondering what the difference between "Don't Restore" and discard is and why both are present. If we had transparency, I think "Don't restore" could be simply "Discard". Interim transparency could be showing the time the unseen revision was made. If it's seconds after the last update, I can be pretty sure I want to discard it. But, I pretty much always want to discard because I know the AYS is always wrong. |
I've worked out one way to consistently reproduce this after whittling down html tags to which ones trigger this. Reproducible Steps
The unsaved changes prompt is displayed even though no changes were made, we only switched between the editors. |
Interesting @alisterscott - I can reproduce, and it actually triggered the message for me after the initial save too. It appears that it will happen with any shortcode, as I was able to trigger the warning by doing the same flow as above, but on a post with a gallery shortcode. Moving from Visual -> HTML with a gallery will throw the warning also. /cc @aduth any thoughts on why toggling between Visual and HTML with a shortcode would flag the post as dirty? |
@timmyc: Another strange thing I saw with this, but I can't reproduce it so I'm hesitant to raise it, but when publishing a post with similar content, sometimes it shows the message "Post Updated" before immediately showing the "Post Published" success message. Could this be related? |
I know that @ryanboren does a lot of galleries so this may be why this was happening for him. Ryan: do you switch between visual and html tabs when editing? |
The "update" button always shows as enabled even without making changes now, is this part of the new editor design or was it always like that? |
There's some duplication between this issue and #6869
When last this was debugged with a fix explored in #6880, I don't recall it being specific to shortcodes specifically, but more around |
Howdy! A user came into chat today to report that she's seeing the same issue. She's on Chrome desktop, and clearing her cache and emptying her cookies doesn't resolve the issue. She said that when she edits a page, then clicks UPDATE, she gets the message that the page updated successfully. But when she tries to exit out of the page, she gets the alert that there are unsaved changes on her site. She exits the page, and when she returns, she gets the other message letting her know that "there is a more recent version of the page, do you want to restore it?" Understandably, she's upset and concerned that she might lost her changes or content and doesn't understand why she keeps getting these alerts. She returned to chat later in the day to ask about the issue again. Ticket: #3151780-t |
Another user came into chat today with the same issue: they keep getting the message saying that they had "unsaved changes" as they tried to navigate away from a page, even though they'd already clicked the UPDATE button to save their changes before getting that message. They said that when they navigate away, sometimes the page changes are saved, and sometimes they're not. They're really wanting some reassurance that when they save their updates, they'll actually be saved. I asked them a few more questions to try and see if there was some kind of unique behavior that might pinpoint the cause. User is on a PC, Chrome browser. They said this at one point:
I tried to get clarification as to what they meant by that. Are they opening up multiple pages in different tabs to edit them, and then toggling back and forth between them? They followed with:
We ended up getting disconnected in chat, so I couldn't follow up with more clarifying questions. I sent the user a ticket so see if they had more insights they could share, so I'll update this if I hear from them again. Ticket: #3238963-t |
This still happens to me almost daily in Chrome and the Mac desktop app. I click Save/Update on a post, wait for it to complete, and immediately try to close the tab or navigate away from the post. I have not touched the keyboard or clicked anywhere else and the AYS will come up. There are even times where I keep clicking Save, wait, and try to leave, but the AYS will keep coming up again and again. Usually I just give up and leave hoping I don't lose something. :-( |
A user reported the same issue using Firefox 53.0 in Windows. From investigating the revision history, it looks like this occurred when proc'ing an autosave call. The latest revision was created by an autosave and has is identical to the current revision. Ticket: #3266324-t |
I'll add my testimony. I also experience this almost daily. Being unreliable and misleading about content state destroys trust and creates anxiety. This is an impactful bug that has been around for over a year, possibly back to the beginning. It interrupts publish and edit flow (the heart of this software) with an AYS, an AYS! That is an interruption that smashes cognitive stacks with a forced decision while burning a click/tap. We're interrupting two of the most critical and anxious moments in this software (the moments after publish/update) to deliver false state information and force a decision based on that false state. IMO, this is a high priority flow and trust killer. |
With the new preview after publish in 2.7.0-beta1, the AYS is coming up when I try to navigate from the Preview to My Sites. |
I've been trying to reproduce this, but haven't been able to. The only bug I can get to happen is the one that's triggered by switching between the @ryanboren, @nickmomrik: Do you have any insights that might help reproduce it reliably? Would you mind writing out the explicit steps again (since Calypso has changed a lot since the original report)? I think it'd also be helpful to have a handful of URLs for posts that you see this happening on. |
Unfortunately there is nothing reliable about it. :-/ Sometimes it happens and sometimes it does not. There is nothing different I'm doing between the cases, because I've resorted to doing absolutely nothing else on my computer while waiting after the save/update/publish click to make sure I'm not triggering anything. Could we add a setting to turn on some debugging that alerts us about what it thinks has changed since we hit save/update/publish? |
It was enabled for both sites I publish to. I don't use it though, so I've turned it off and will see if I notice a difference. |
#6869 shows how it's easy to make the editor state dirty merely switching between Visual and HTML modes using shortcodes like gallery without making changes so I think that may influence some of these reports, particularly for advanced customers using HTML mode: |
I had two more reports this week in on the French forums:
Had them both try other browsers/computers/internet connection, but the issue is still here. |
Another user report of this in 1277576-zen. This is happening on all of their posts, even immediately after updating/publishing. |
Another report in #1278537-zen. They say it has been happening for the last few weeks. |
Re-posting the report by @slicesofamerica which had int links:
|
Two more reports: #5045852-hc - User This happened in Chrome, Firefox, and Safari when in Calypso. I replicated it myself. It doesn't happen in WP-Admin. |
OK, I think I've got a bead on at least one of the major causes of this as per recent reports... Spacing in inline styles is prone to keeping the editor marked as "dirty." Here's a simple way to reproduce:
I'm seeing the prompt 100% of the time for this case. I tried manually calling When Calypso attempts to resolve the As @alisterscott pointed out with regards to shortcodes, switching to the visual editor is one way this can be elicited. I suspect that something changed in the visual editor that, while not the cause of these symptoms, has exacerbated it by putting these sorts of whitespace in the content. ...continuing to dig. |
Keeping the "dirty" flag correct has been a topic of many subtle bugs for a very long time, but the latest issues were caused by the Reduxification work. The algorithm for the following flow has changed:
The old Flux algorithm stored the edits-while-saving into a queue and applied them to the post returned from server after save finished. Similar to "git rebase" The new Redux algorithm is different: it continues to apply the edits to the "current" post, and when save REST response arrives, tries to merge the two versions of the post by comparing attributes. Similar to "git merge" This works well for all attributes except content: there are filters and normalizations being applied on the server that make the content returned in REST response different from what was sent in the request body. That defeats the "dirty" check and there is no way to distinguish the "important" edits from "unimportant" ones. I'll work on a PR that improves the Redux algorithm when saving content. |
Another case to report: 3858433-hc User said it's been happening "over the past couple of days" after publishing a post. Using chrome. |
User #1276973-zen back with this additional info:
|
Another user facing this issue- 1286248-zen The User facing an issue while writing posts. When they edit the post, click Save to save the changes, then hitting the Close button gives them the 'AYS' warning. |
I researched the "space-in-style-attr" bug reported by @jblz in #9833 (comment) and it's interesting that it happens only on Simple WP.com sites. Jetpack and Atomic sites keep the whitespace as-is, don't clean up the content and don't trigger the AYS bug. Apparently the server-side filters for content (there are several) are different for each site. I'm working on this today. |
One more user is facing this issue- 1290581-zen The user is getting the warning, "You have unsaved changes. Are you sure you want to leave this page?" every time they save. |
Another user is facing the same issue here - 1293710-zen User is having an issue with the page "Queenies Closet" while saving it, seems to trigger the AYS dialogue box. Asking to save again even though they have just saved it. |
After making the Markdown changes, it's still happening for me. |
@nickmomrik I couldn't reproduce the bug when editing a post with Markdown enabled. (I enabled it in wp-admin in the Settings -> Writing section on a Simple site, maybe there is some different "Markdown support" I'm not aware of). It would help me a lot to have reliable steps to reproduce, and a GIF video always helps, too 😉 Also, it matters a lot whether the site is Simple, Atomic or Jetpack one -- each type has slightly different plugins and that influences how posts are transformed on save. |
I disabled Markdown as a test (and since I don't use it) based on #9833 (comment) I've been experiencing these AYS issues with 2 WordPress.com sites. It would be great if there were reliable steps to reproduce this, but I've never been able to notice a pattern. |
For this user in #1276973-zen back the site is a simple site and the problem is happening for multiple admins. They say the problem is sporadic and does not seem to have any pattern. It is not specific to one page. They also said they as far as they can see even though they get the message that changes were not saved, they have not actually lost the changes they made. I am asking them to try making some edits and letting us know if they get the error. I have not been able to produce it on my end. |
Still happens to me almost every day. |
Hi @nickmomrik, if you have reliable steps to reproduce (having these makes all the difference between fixing and not fixing a bug), please file a brand new issue. This one already became a confusing mix of many different bugs that are not always related to each other. |
Unfortunately there has never been a reliable set of steps. |
I've got a customer still reporting this too, though I also don't have reliable repro steps. |
There's a very slight chance that this will help anyone, but I've encountered the same problem in the classical editor of WordPress while using the submitanyway library. The code that was triggering it was as simple as: $(selector).submit(function(ev) {
ev.preventDefault();
this.submit();
} |
Often (but not always), immediately after publishing or updating, I see this AYS (are you sure) dialog when I attempt to navigate away from the editor via the <- Back button. Having to dismiss an unnecessary dialog is annoying, but the much bigger problem is that I can’t trust an editor that makes the save state of my content so ambiguous. One of my editor prime directives is, “Don’t AYS for unsaved changes if there aren’t unsaved changes.”
This ambiguity follows when you edit an existing post. I haven’t visited the post below in 3 years. When I open it, I get a restore unsaved changes prompt. This happens for lots of my old posts.
What am I restoring? I just want to peek the post right now, not edit it, so I click “Don’t restore”. I’ll postpone dealing with it until next time I venture to this post. After reading, I click the editor’s back button to return to my posts search and receive an unsaved changes AYS (Are You Sure). That’s an interruption on the way into the post and one on the way out. Unless I restore unseen changes, I will be twice interrupted on every visit.
Untrustable editor AYS comes up in user testing, it comes up in internal testing, yet its misbehavior endures. Here’s an anecdote from a recent user testing session.
Related issues:
Included screenshots are Macnchrome, latest of each.
The text was updated successfully, but these errors were encountered: