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

Previews: cannot preview a published post that has an autosave #7852

Closed
maddisondesigns opened this issue Jul 10, 2018 · 6 comments
Closed
Labels
[Feature] Saving Related to saving functionality [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Milestone

Comments

@maddisondesigns
Copy link

Describe the bug
This bug has come and gone several times and it appears to be back again. I simply clicked on a page to edit it, and before I did actually start editing, I clicked on Preview. The front-end simply shows Please wait… Generating preview and never actually displays the page.

screenshot_726

To Reproduce
Steps to reproduce the behavior:

  1. Open previously published page (in the Dashboard)
  2. Click on Preview button

Expected behavior
Published page should open in new browser tab

macOS Sierra 10.12.1
Firefox Quantum 61.0.1 (64-bit)
Gutenberg 3.2.0

@designsimply
Copy link
Member

I tested with WordPress 4.9.7 and Gutenberg 3.2.0 using Firefox 61.0.1 on macOS 10.13.5 and was unable to reproduce the problem based on your steps. Here are the scenarios I tested:

Video: 1m18s

  1. Open a published post, click Preview.
  2. Open a published post, make a change, click Preview.
  3. Open a draft post, click Preview.
  4. Open a draft post, make a change, click Preview.
  5. Start a brand new post, click Preview before autosave.

@maddisondesigns would you mind having a look at the video linked above and let me know if you can see anything different in my tests compared to yours? I noticed the url in your screenshot is dev.wordpress-test.com/wp-admin/post.php?post2852&action=edit which makes me think you may be using a local install running bleeding edge. Are you running 3.2.0 stable or a different revision of Gutenberg? If it's the 2nd thing, let me know what revision you are on and I'll try to match up with you for testing.

fwiw, I have seen that bug before but for the life of me couldn't break it with 3.2.0 today when I tested!

@designsimply designsimply added the [Status] Needs More Info Follow-up required in order to be actionable. label Jul 11, 2018
@maddisondesigns
Copy link
Author

The site I'm using is a test site on my own local server but I'm only using the stable 3.2.0 plugin version of Gutenberg.

I've disabled all plugins, retested and can consistently reproduce the issue by adding a Classic block.

The test page where I first encountered the error had all sorts of different blocks on it. To try and narrow it down I created a new page and started adding different blocks and clicking preview. As soon as I add a Classic Block, the preview breaks.

Here's a vid: https://cl.ly/0J071E2z0u1F

@mtias mtias added the [Feature] Saving Related to saving functionality label Jul 19, 2018
@designsimply designsimply added Needs Testing Needs further testing to be confirmed. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Jul 19, 2018
@designsimply
Copy link
Member

Nice sleuthing! I added the Needs Testing label so someone can loop back around and help test/verify.

@Clorith
Copy link
Member

Clorith commented Jul 22, 2018

I'm able to reliably reproduce this, it seems that if you hit the preview button before some kind of state change occurs, it's left in the "generating preview" screen for ever, it's not receiving the URL it needs to redirect to. If you wait a second or two after updating before hitting the preview, it works just fine.

I'm wondering if implementing #7922 (comment) would remove this problem entirely, as it seems to be the intermediary of our fancy "generating preview" page that's causing the issue, and the content is already saved and ready for viewing?

@designsimply
Copy link
Member

designsimply commented Aug 14, 2018

I re-tested and found that previews get stuck for me any time I try to preview an autosaved post:

  1. Create and publish a post.
  2. Make a change to the post and leave without saving.
  3. Re-open the post and see an autosave notice at the top.
  4. Click the "Preview" button.

Result: cannot preview a published post that has an autosave.

Video: 41s
Seen at http://alittletestblog.com/wp-admin/post.php?post=14242&action=edit running WordPress 4.9.8 and Gutenberg 3.5.0 using Firefox 61.0.2 on macOS 10.13.6.

autosave-400-error-when-trying-to-preview-a-post-with-an-autosave

Here is the autosave API response from the Network tab in my browser:

{"code":"rest_autosave_no_changes","message":"There is nothing to save. The autosave and the post content are the same.","data":{"status":400}}

@maddisondesigns can you check to see if the steps above consistently result in stuck previews for you?

@designsimply designsimply added [Type] Bug An existing feature does not function as intended and removed Needs Testing Needs further testing to be confirmed. labels Aug 14, 2018
@designsimply designsimply added this to the 3.6 milestone Aug 14, 2018
@designsimply designsimply changed the title Preview not working on Published Page Previews: cannot preview a published post that has an autosave Aug 14, 2018
@designsimply
Copy link
Member

While researching preview issues today, I realized that this one is a duplicate of #7416.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Saving Related to saving functionality [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants