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

Post Editor: Autosaves are no longer saving a revision #20265

Closed
jblz opened this issue Nov 27, 2017 · 116 comments
Closed

Post Editor: Autosaves are no longer saving a revision #20265

jblz opened this issue Nov 27, 2017 · 116 comments
Labels

Comments

@jblz
Copy link
Member

jblz commented Nov 27, 2017

I'm not 100% sure, but my gut says that something changed relatively recently in the way we handle revisions for post (and page) drafts when the editor performs and "autosave."

@designsimply & I both seem to recall that, until recently, the Calypso editor deviated from core WordPress behavior in that "Autosaves" to drafts resulted in revisions being saved (they're explicitly blocked from doing so in core).

When I look back through moderately old posts and pages, the revisions seem to corroborate our gut feelings. There's also this from the WPCOM support docs:

Each autosaved copy of the post is saved, and you can browse and restore prior versions by clicking on Revisions.

This is maybe related to the change in #19261: passing the autosave param to the API call results in the DOING_AUTOSAVE constant getting set. /cc @roccotripaldi

It defintely seems like the correct semantics to set this constant for these calls -- we are, after all, doing an autosave. This becomes a bit problematic, however, in the case of co-editing a draft (see steps to reproduce below for why).

My question here is, should we patch core somehow to allow us to save revisions for autosaves as before?
By not doing so, could subsequent changes by other users could result in an inconsistent content state and / or data loss?

Steps to reproduce

  1. Starting at URL: https://wordpress.com/post
  2. Choose a test site with multiple user account on it
  3. Draft a post & make multiple changes
  4. Witness the "autosave" feature kick in after periods of inactivity (the Save button changes to Saved)
  5. Make some more changes and click Save before the autosave feature kicks in (do this a few times for good measure)
  6. Open the draft for editing as the another test user
  7. Make some changes & watch the autosave kick in
  8. Return to editing as the original user

What I expected

  • In item # 7 above, I expected to see my changes persisted because the UI told me they were Saved
  • In item # 8 above, I expected to see the changes from the second user somewhere because they told me they were saved (because the UI told them they were Saved)

What happened instead

  • The draft was not updated.
  • No revisions were created.
  • The contents of the Autosave were not available to the original author at all.
  • The other user assumed their changes were saved in a way I'd be able to see them & I was not.

Context / Source

#dogfooding #anxiety #painpoint.

@jblz jblz added API [Feature] Post/Page Editor The editor for editing posts and pages. [Type] Question labels Nov 27, 2017
@jblz jblz changed the title Post Editor: Autosaves are no longer save a revision Post Editor: Autosaves are no longer saving a revision Nov 27, 2017
@lancewillett
Copy link
Contributor

@mcsf @mtias In the context of Gutenberg, will there be built-in revisions? Or will it tie into core functionality related to Calypso via an API?

One concrete example we need to tackle is real-time editing, where the client maintains state and pushes-pulls changes from the server via an API. Based on certain conditions, we'd love to be able to intelligently push client-side auto-saves to the server — which core WP doesn't currently support.

Knowing what's coming for Gutenberg will help Delta / Samus prioritize work on post revisions in Calypso. Thanks!

@lsinger
Copy link
Contributor

lsinger commented Nov 29, 2017

An additional data point:

I edited a draft started by a colleague, but my changes didn't show up for me as a revision in the history. They appeared "saved." They showed up in preview. They show up now that the original author has published it.

And now that it's published, they even show up in the revision log / history — under the original author's name, and timestamped to when he published it.

@mtias
Copy link
Member

mtias commented Nov 29, 2017

@lancewillett we are not touching the revisions interface directly. There are issues with the API and how it handles revisions, as right now it is creating a lot. Ideally core knows what should be a revision and what should not be, and the client doesn't have to handle that.

@aduth
Copy link
Contributor

aduth commented Nov 29, 2017

The behavior was recently changed server-side defining the autosave constant, which is checked as a condition for aborting the creation of a new revision:

https://github.com/WordPress/wordpress-develop/blob/c52f6ba99510afa345637ca1734176bd3e88250b/src/wp-includes/revision.php#L113-L114

r165508-wpcom

@aduth
Copy link
Contributor

aduth commented Nov 29, 2017

Also noting that, as described, this is "working as intended" so far as how core has traditionally treated autosaves. The previous Calypso behavior of autosave was effectively the same as a "full" save, at least for drafts, revision and all. For WordPress.com, it's been fine enough, since it can be occasionally handy to persist frequent revisions, and we're more okay with the data requirement hit. Ideally there's some middle-ground where the server is smart enough to combine multiple changesets made within a short timeframe, or more efficiently store diffs between two states of post.

See also: WordPress/gutenberg#3656

@kraftbj
Copy link
Contributor

kraftbj commented Nov 29, 2017

I'm having trouble finding it, but excessive revisions was a known issue/problem from the Jetpack side when using Calypso. When using Calypso, you could easily rack up hundreds of revisions for a single post, each one having only a few words changed, but with no easy way to filter them out.

One idea I had was add meta data to the auto-saved revisions that were saved so they would be automatically dropped after X number or drop any older than Y when the post was saved, so we could still keep the latest few autosaves in the end of a diaster, but not kill a db.

@jblz
Copy link
Member Author

jblz commented Nov 29, 2017

excessive revisions was a known issue/problem from the Jetpack side

Definitely -- the number of draft autosaves we were seeing in revisions were borderline problematic on non-jetpack sites as well (in terms of UX)

One idea I had was add meta data to the auto-saved revisions that were saved so they would be automatically dropped after X number or drop any older than Y when the post was saved, so we could still keep the latest few autosaves in the end of a diaster

Clever. Although, old revisions are cycled out as the limit is hit, so this might be kind of moot.

Something else we've talked about for a quick workaround is to trigger a call to create a revision on a significantly longer debounce timeout so we don't accrue so many revisions. This might be a happy medium -- at least on draft content where the Save / Saved indication is so prominent

@kraftbj
Copy link
Contributor

kraftbj commented Nov 30, 2017

Clever. Although, old revisions are cycled out as the limit is hit, so this might be kind of moot.

True. Core doesn't impose a limit, so Jetpack sites potentially could have a metric ton of revisions. WP.com looks to cap it at 25 for non blue/VIP flagged sites.

@rossanafmenezes
Copy link

rossanafmenezes commented Dec 13, 2017

Hi there! Is this being addressed? I have been getting some users on LC complaining about their changes not being saved even though it shows as saved and also not showing on their history so they can't go back to previous versions. I have just done a test myself to one the users (interstrates
) and while at my end the change was saved, the last revision showing was from 18 hours ago.

CHAT 1282963-hc
Ticket 845066-zen

@lancewillett
Copy link
Contributor

trigger a call to create a revision on a significantly longer debounce timeout so we don't accrue so many revisions

This is the best solution, in my opinion — we want to avoid sending each character change as a revision. There are more elegant ways to solve it, but I think we should focus on other work.

@oandregal
Copy link
Contributor

This issue may be the cause for 1027324-zen - user reported their content was lost while writing and he can't access the history.

@dllh
Copy link
Member

dllh commented Apr 20, 2018

I think 1978240-chat may be another case of this, but I'm not certain.

@davipontesblog
Copy link
Contributor

I have a user who swears they have worked on a post “all night” but there are no revisions in the post in calypso (post is saved as a draft currently). The post is currently blank. Do we perhaps not save revisions on drafts? I didn’t think this was the case, and there are no mentions we don’t here. Is this related to this issue?
#1170022-zen
#3719281-hc

@akmyta
Copy link

akmyta commented May 22, 2018

I have a user who was working on a post (which is saved as a draft) and the next day found that half their content had disappeared with no revisions available. User saved the post not only by the autosave feature but confirmed that they have also clicked "Save" as well throughout the building of their content. I'm thinking this is related to this issue but want to double check.
#1176908-zen

@pauljacobson
Copy link

We have what appears to be a related report in 1235098-zen. Here is the initial issue:

I have a specific page following is the its link. This page doesnt open for me and when I click it, it keeps loading but never shows. I had the same prob before so i created a new page with the same content. Looks like the problem continues.

The user and HE troubleshooted by checking alternate browsers, clearing browser cache, and checking browser extensions. These didn't appear to resolve the issue. The user's subsequent testing seems to point to an autosave issue.

Steps to reproduce

The user did some testing for us in order to reproduce the issue:

  1. Open a page (after logging into Wordpress)
  2. Click edit button at the bottom of the page.
  3. Make some changes to the page.
  4. Don’t save it, leave the page for say 15 min.
  5. Hit Update button at the top right corner, the draft expires because of inactivity, so it will say ‘cannot save’ so close the edit or close the browser.
  6. Now, try opening the page, and it will say page not found.
  7. When You (on ur end) open the same page, you do it as an external user and not logged into Wordpress user, so it works. For me as long as I am logged in I can’t open so I can’t edit.

There is a video in the ticket (I haven't included the video here because it may contain personal information).

What I expected

The autosave feature should preserve edits to a Post or Page, leaving the published version accessible through it's link, while retaining saved updates for further review and publication through the Revision History.

What happened instead

Leaving the Page open in the editor for 15 minutes, then returning to the editor to save the Page, results in the Page becoming inaccessible using it's URL.

Browser / OS version

Google Chrome and Internet Explorer on Windows. The user mentioned that when they tested the specific page link in Safari on their Mac and iPhone, the link worked.

@eurello
Copy link
Contributor

eurello commented Jul 15, 2018

I think this might have happened in #1279237-zen. User had a very long post that they worked on one day, but we have no revisions saved from that day, only revisions from several days before and several days after.

@KokkieH
Copy link
Contributor

KokkieH commented Aug 15, 2018

Several more reports that appear to be about the same issue in p2EDhh-tH-p2

@ajaykj
Copy link

ajaykj commented Jul 14, 2019

13978631-hc

Content lost when adding an image. No post-revisions or history found on the post. The user was using Chrome.

@kcswong
Copy link

kcswong commented Jul 16, 2019

Content lost when adding an image as well. No history. Using Chrome.

14033108-hc

@anant1811
Copy link

Another report in 2175757-Zen. In this case, the user mentioned seeing it autosave but later when they went back to the post, they realised they have lost the changes.

Also, no post-revisions or history found on the post.

@anant1811
Copy link

Another one, 199847-hc
Post having issue: post/pensionarnysspensionar.com/21721/

This user also reported that they saw the post Autosave.. and later, the content was missing because they didn't manually save/update it.

@jsnajdr
Copy link
Member

jsnajdr commented Jul 22, 2019

Fix for Simple sites was deployed to WP.com earlier today in D30389-code.

If an autosave is significantly different from a previous one that is going to be overwritten, we create a permanent post revision from that autosave. Normally, revisions are not created for autosaves. Now, if a user finds out she lost her post content, she can open the Post Revisions dialog and the lost content should be there as one of the last revisions.

More patches will be needed to deploy this fix for Atomic and Jetpack sites, too. I'll post updates as we proceed.

@thesacredpath
Copy link

thesacredpath commented Jul 23, 2019

User just provided a screencast of the issue.

https://trendings616160297.blog/screen-recording-2019-07-23-at-1-41-52-am-mov/

2199399-zen (Atomic site)

@eoinsav
Copy link

eoinsav commented Jul 31, 2019

Another report of a page not auto-saving. They lost 40-minutes of work: 14316373-hc (WordPress.com Premium)

Update from Sheri:

User description of the problem:

i was just finishing up a new page
i hit 'publish;
and it said you are not allowed to edit this post
and now it seems to be gone?

Based on the user's description of the problem in this case, it sounds they opened a page for editing while logged in as one account then logged out of WordPress.com and back in as a different account (or maybe they just got logged out somehow?) and then tried to edit the draft they previously started. I am not sure how else to interpret their explanation because the 'you are not allowed to edit this post' message should only appear if the currently logged in user doesn't have sufficient rights to edit the page.

I also noticed that the a revision was saved for that user's page (blog_id 152521822, page_id 402, revision 403) when they created it on 29 Jul @ 18:29 and the revision showing the initial save had a title of "Auto Draft" and the content was completely empty.

@eoinsav
Copy link

eoinsav commented Aug 1, 2019

Another report here: 14334065-hc (WordPress.com Premium plan simple site)

They saw it autosaving but came back to the post and their changes were no longer there. There are Post Revisions on the post but they are older, which I assume means the post was published and then changed to a draft while they made edits.

@designsimply
Copy link
Contributor

designsimply commented Aug 1, 2019

@eoinsav can you please note the type of site when you add notes about new reports? And a quick user quote explaining the problem if you've got anything quotable/helpful!

@jsnajdr
Copy link
Member

jsnajdr commented Aug 1, 2019

@eoinsav @designsimply There are several important details that are helpful when debugging autosave issues:

  • is the site Simple, Atomic or Jetpack? We deployed an autosave enhancement/fix to Simple sites several days ago, but we're still wrangling the Atomic deployment
  • which editor exactly was used? We have four combinations of Classic and Block editor in Calypso and wp-admin. They differ in several subtle details: whether they use auto-drafts or not, whether they ever lock the edited post or not...
  • when the content was lost (that can happen for variety of reasons), is there a permanent revision (or several of them) that has been saved during the edit? That's what our fixes are about: make the content-losing bugs recoverable rather than attempting to fix all of them

@eduardozulian
Copy link
Member

eduardozulian commented Aug 6, 2019

Another report:

  • 3742331-hc
  • Follow-up: 2254372-zen
  • WordPress.com simple site
  • Premium plan
  • Classic Editor

User info:

  1. Started a draft and added quite a lot of content
  2. Made sure that the draft saved several times
  3. Always save manually after an editing session.
  4. Went to the draft today and all the content other than the title has gone.

Also:

  • There were several hyperlinks in the text, but the user has used these links before.
  • There were no photos added.
  • The only thing different was that prior to creating that post, the user changed the theme to Clear News

@msilbers
Copy link

msilbers commented Sep 3, 2019

reported in #6127572-hc

WordPress.com simple site, Personal plan
They access their drafts from Calyspo, Block Editor
Safari version 12.1.1

They started a draft on 8/29 and worked on it for an hour or two, letting it auto-save the whole time. They say the auto-saving was visibly happening, so they never tried to manually save it. The post was all text only (paragraph blocks).

There are no revisions saved, not even the title of the post. It doesn't appear in the activity log and there's no record of a deleted post.

"I had written a post this last Thursday 8/29 titled Saturn Return, it said it autosaved but now it is nowhere to be found..not in drafts or trash, is there anyway to restore it - please help!" - user quote

@galakhyati
Copy link

Another user reported the issue: #2387674-zen

@designsimply
Copy link
Contributor

@galakhyati can you add a bit more detail for the case you reported?

  • Is the site Simple, Atomic or Jetpack?
  • Which editor exactly was used?
  • When the content was lost, was there a permanent revision saved?

@cameronvoell
Copy link

cameronvoell commented Oct 11, 2019

Have a user with missing revisions: 2411956-zen
Interestingly I've verified edits show up in the site activity log, but do not show up in the post history revisions.

@kriskorn
Copy link
Contributor

Happychat: 16340669-hc

is the site Simple, Atomic or Jetpack?

Simple.

which editor exactly was used?

Block editor in Calypso.

when the content was lost (that can happen for variety of reasons), is there a permanent revision (or several of them) that has been saved during the edit?

There is no sign of that post in the drafts or anything at all. No Activity log message. Totally vanished.

@ivan-ottinger
Copy link
Contributor

Another report:

Ticket: 2470571-zen
WordPress.com Simple site (Free)
Block Editor, Calypso

User info:

I just wrote a test post on [site address], my wordpress.com site, and autosave never turned on. When I tried to navigate away from the page, it gave me the pop-up warning that I had unsaved changes

I also tried to test the autosave and it didn't work at all for me. Even after I clicked "Save Draft", the autosave didn't seem to trigger. 🤔

@eduardozulian
Copy link
Member

  • Chat: 17351599-hc
  • WordPress.com AT site
  • Classic Editor
  • Edge 18.17763 on Windows 10.0.0

Extra info:

  • That they were using the same computer on both edits
  • They are using the Classic editor for a while now, so it wasn't an editor switch issue
  • They didn't manually save the post but relied on the autosave tool
  • No revisions saved

@kwight
Copy link
Contributor

kwight commented Dec 17, 2019

This thread contains references to all three editors (Calypso - the OP, Gutenberg, and Classic); I think we'll need to split these out to separate issues, since they handle revisions differently, and this issue is becoming a bit of a dumping ground for any revision issues.

@gwwar
Copy link
Contributor

gwwar commented Mar 2, 2020

For folks that are assigned to this, please close out this issue in favor of a milestone or project that captures problems noted in this long thread. Note that this will likely require an audit before we can create actionable issues. Many of the reports here are based on content loss symptoms, which may involve many bugs/flows to resolve.

Once a project/milestone is created, we can help prioritize and get folks assigned to tasks.

See also p7jreA-1y8-p2 for tips on how to approach this or DM me if folks had questions.

@creativecoder creativecoder removed their assignment Mar 3, 2020
@davemart-in
Copy link
Contributor

The Calypso editor is in the process of being deprecated. I'm going to close out this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests