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

Editor: Don't edit the post when autosaving. #17420

Merged
merged 1 commit into from
Sep 13, 2019

Conversation

epiqueras
Copy link
Contributor

Description

This PR stops the editor from clearing redo levels when autosaving.

How has this been tested?

It was verified that autosaves no longer clear the redo stack.

Types of Changes

Bug Fix: Stop autosaves from clearing the redo stack.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@epiqueras epiqueras added [Type] Bug An existing feature does not function as intended [Package] Editor /packages/editor labels Sep 12, 2019
@epiqueras epiqueras added this to the Future milestone Sep 12, 2019
@epiqueras epiqueras requested a review from talldan as a code owner September 12, 2019 18:30
@epiqueras epiqueras self-assigned this Sep 12, 2019
@@ -390,6 +393,7 @@ export function* savePost( options = {} ) {
previousRecord.type,
previousRecord.id
) ),
...edits,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain this concatenation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still want autosaves to have the latest content. This makes sure of that without editing the entity.

Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, but there's still several concepts to track in just one action creator. We need tests for this sort of regression, could you work on it?

@epiqueras
Copy link
Contributor Author

Yes, this warrants more E2E tests, I made an issue for it: #17434. I think @ellatrix has already started working on it a bit as well.

Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, alright, let's not let #17434 stagnate, but I can approve this one in the meantime. :)

@epiqueras epiqueras merged commit 9b83d3f into master Sep 13, 2019
@epiqueras epiqueras deleted the fix/autosaving-creating-edits branch September 13, 2019 21:11
@youknowriad youknowriad modified the milestones: Future, Gutenberg 6.5 Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants