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

Autosave loses edits that happened during the save #2315

Closed
notnownikki opened this issue Aug 9, 2017 · 3 comments · Fixed by #2319
Closed

Autosave loses edits that happened during the save #2315

notnownikki opened this issue Aug 9, 2017 · 3 comments · Fixed by #2319
Assignees
Labels
[Type] Bug An existing feature does not function as intended
Milestone

Comments

@notnownikki
Copy link
Member

Issue Overview

Text blocks created quickly by typing, pressing enter, and typing again, can disappear.

Steps to Reproduce (for bugs)

Reproduces in Chrome and FF:

  1. New post
  2. Quickly alternate between pressing 'x' and enter

Expected Behavior

Should get a list of blocks, each with 'x' in them

Current Behavior

Blocks go missing.

missing

Possible Solution

Possibly autosave related?

Related Issues and/or PRs

Possible duplicate of #2314

@notnownikki notnownikki changed the title Can't create new text blocks in rapid succession Autosave loses edits that happened during the save Aug 9, 2017
@notnownikki
Copy link
Member Author

notnownikki commented Aug 9, 2017

Easier way of reproducing this:

  1. Create a new post
  2. Type something in the first text block
  3. Press enter to create a second text block, then hold down a key so that the block is constantly being edited.
  4. Wait for autosave to kick in.
  5. Watch the block you were editing, disappear.

When autosave runs, it triggers a REQUEST_POST_UPDATE effect.

In editor/effects.js, starting on line 56:

		new Model( toSend ).save().done( ( newPost ) => {
			dispatch( {
				type: 'RESET_POST',
				post: newPost,
			} );

This updates the post, and resets the post based on the post saved. But if someone is typing or creates a new block while the save was going on, their edits are lost, and if they've created a new block while the save was happening, their new block is lost and they lose editor focus.

I'm not sure what solution would be acceptable here. I don't think we should be resetting the post at all in this effect, but I'm not sure why we do. But, it is the culprit for losing edits, and Calypso had this same problem about 5 months ago (I was on my support rotation, and dealt with the poor guy who kept getting hit by it due to his slow internet connection!)

Paging @aduth and @youknowriad for more input here.

@aduth aduth self-assigned this Aug 9, 2017
@aduth aduth added the [Type] Bug An existing feature does not function as intended label Aug 9, 2017
@aduth aduth added this to the Beta 0.8.0 milestone Aug 9, 2017
@youknowriad
Copy link
Contributor

duplicate #2300 ?

@aduth
Copy link
Member

aduth commented Aug 9, 2017

Yes, appears to be a duplicate, but good reference text here too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants