I'm not sure if this is a JS (frontend) or Node (backend) problem (we use Express), but it seems that when a preview token expires (let say I was in preview mode and comeback a week later on our website), the site hangs indefinitely. The solution so far is to ask my team to clear the "Application data" in Chrome, which I think clear the expired preview token.
In the GitHub issue I pasted all the code related to this, let me know if you need anything else on my end.
Welcome to the Prismic Community Forum. Thanks for posting this question. I've submitted a request to our dev team to look into it. I'll let you know what happens next.
Thanks for checking in. I've spoken to our dev team about this, and they're looking into it. If I don't hear anything back from them this week, I'll follow up on Monday and let you know what they say
Good day. This issue is still causing trouble to my team and as a paying user, I'm disappointed by the lack of support this is receiving. I'm willing to share whatever is missing to help you debug this.
Sorry for the silence on my end. I've been going back and forth with the dev team on this.
Can you explain a little more about the context of the issue, so I understand better?
Usually, a user would launch a preview from the editor, and close that preview when they're done. A week later, they might launch another preview from the editor. It sounds like you're describing a different workflow. Can you clarify for me?
An editor launch a preview, then start editing while previewing in real time. He never presses the "X" in the widget at the bottom. He might (or not) publish the article he was previewing at some point. The editor's browser is never closed (so the preview session cookie isn't cleared). At some point, when the editor tries to access the site again (this could be a couple days later), the site hangs and returns the error highlighted in my post. It looks like the preview token is expired and the error is never caught by Prismic, so the site just hangs. The workaround is to wait for NGINX to timeout, then go in "Application Data" and clear all website's cookies.
@allaire Thank you for the extra info! I've gone back to my dev team with it, and I'll let you know what I hear back. I'm out of the office on Friday, but we've got a sync scheduled for Monday, so I'll check on the progress then and get back to you the same day.
I've talked to the dev team about this, and they've added the issue to their tracker. I can't say when they'll address it, but I'll let you know if there's any movement! In the meantime, let me know if you want to talk about other ideas for workarounds.