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

State: Avoid URL redirect for published post autosave #7067

Merged
merged 1 commit into from
Jun 1, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented May 31, 2018

Fixes #7066

This pull request seeks to resolve an issue where the editor URL is replaced with an autosave ID when autosaves occur for published posts. Since autosave posts are not directly editable, this results in an error message if the user proceeds to reload the page.

Implementation notes:

As part of some consolidation refactoring in #6257, I made assumptions about an autosave success result receiving a post object, which is only partly correct. In fact, the autosave endpoints return a subset of post properties. Notably, this does not include some properties like status, which is considered in both the effects handlers for post save success and failure, and would be undefined in the case of an autosave. Since these handlers seem to handle this gracefully, I did not address that as part of the changes here, but it seems fragile to allow this assumption to continue.

This change was intended to be the minimal fix to allow a 3.0 release to proceed, but I'd like to proceed with future refactorings of this behavior in subsequent pull requests, both:

Testing instructions:

Repeat steps to reproduce from #7066, verifying that no error screen is presented, and that the browser URL does not change after an autosave occurs for a published post.

Ensure unit tests pass:

npm run test-unit ./editor/store/test/effects.js

@aduth aduth added the [Type] Bug An existing feature does not function as intended label May 31, 2018
@aduth aduth added this to the 3.0 milestone May 31, 2018
@youknowriad
Copy link
Contributor

Maybe it's not related to this PR but I'm not seeing the autosave prompt after refreshing the page?

@aduth
Copy link
Member Author

aduth commented Jun 1, 2018

@youknowriad That's expected. See also #4218, ##4112 (comment) . Maybe if release is by Monday we can see about getting #4218 in as well for a complete autosave experience.

@adamsilverstein
Copy link
Member

👍 LGTM

@aduth aduth merged commit 3e36b46 into master Jun 1, 2018
@aduth aduth deleted the fix/7066-publish-post-autosave-redirect branch June 1, 2018 13:38
@aduth
Copy link
Member Author

aduth commented Jun 1, 2018

Thanks for the review @adamsilverstein !

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 this pull request may close these issues.

Autosave: Refreshing the screen after a published post autosave lands on error page
3 participants