Page MenuHomePhabricator

Update books workflow to account for longer render times
Open, Stalled, HighPublic

Assigned To
None
Authored By
ovasileva
Sep 22 2017, 10:14 AM
Referenced Files
F9732517: failed.png
Sep 22 2017, 9:13 PM
F9732513: creating.png
Sep 22 2017, 9:13 PM
F9732515: done.png
Sep 22 2017, 9:13 PM
F9732456: mock-with-spinner.png
Sep 22 2017, 9:07 PM
F9730546: download-ending.png
Sep 22 2017, 7:25 PM
F9730602: old-ui.png
Sep 22 2017, 7:25 PM
F9730593: Artboard Copy 8.png
Sep 22 2017, 7:25 PM
F9730547: download begin.png
Sep 22 2017, 7:25 PM

Description

Background

It seems that the headless Chrome version of the book renderer will take quite long to render an article. We should update the workflow for book creation to highlight this to users

Proposed workflow

  1. User selects "Download" from the book creator (Special:Book)
  2. System displays the following information

"You PDF book is being processed and will be downloaded shortly. Please, do not close this window."

System renders PDF in the background and automatically starts download

Mock

As we can't show "progress" it will have to be a spinner animation while we generate the book

creating.png (1×2 px, 521 KB)

successful

done.png (1×2 px, 517 KB)

failed

failed.png (1×2 px, 522 KB)

  • for all cases we can just say "it might take few minutes" and let the user know that it will start the download when it's ready. this implies do not close the window.

Event Timeline

ovasileva edited projects, added Web-Team-Backlog (Design); removed Web-Team-Backlog.

@bmansurov - is something like this possible? If so, the will the browser notify the user when download is complete?

It seems that the headless Chrome version of the book renderer will take longer to render a book than OCG did.

This is not necessarily true (it maybe true, but we haven't checked that). We didn't compare headless Chromium to the current OCG backend. What we did was measure if it was possible to render books with thousands of pages and the answer was a "YES" (as opposed to a "NO" from Electron). This task is here because the proposed headless Chromium backend will have to lift the load of both ElectronPdfService and OCG, thus increasing the load on servers, which is why we think the render processes maybe slow. For example, if someone is rendering a 1000 page book, and another person initiates a one-article PDF render, then the second person may have to wait because the server is busy with rendering the book. We also suppose that the current Electron backend fails so much because jobs are not queued (needs verification from someone who knows the Electron backend well).

As for your workflow, it is JavaScript friendly, it won't work for non-JS users. I suggest once the user clicks on the download button, we take the user to a page where we show a message saying that the book is being rendered and a link will show up here. We then process to poll the backend every, say, 5 seconds and show the download link when it's ready. We'll also have a message for non-JS users to refresh the page to see an updated status message or the download link if it's ready.

It seems that the headless Chrome version of the book renderer will take longer to render a book than OCG did.

This is not necessarily true (it maybe true, but we haven't checked that). We didn't compare headless Chromium to the current OCG backend. What we did was measure if it was possible to render books with thousands of pages and the answer was a "YES" (as opposed to a "NO" from Electron). This task is here because the proposed headless Chromium backend will have to lift the load of both ElectronPdfService and OCG, thus increasing the load on servers, which is why we think the render processes maybe slow. For example, if someone is rendering a 1000 page book, and another person initiates a one-article PDF render, then the second person may have to wait because the server is busy with rendering the book. We also suppose that the current Electron backend fails so much because jobs are not queued (needs verification from someone who knows the Electron backend well).

Makes sense. I can make a correction in the description. I'm curious - do we know if this was one of the original issues with OCG? As in, was OCG failing while rendering single-page and books (prior to our deployment of Electron)?

As for your workflow, it is JavaScript friendly, it won't work for non-JS users. I suggest once the user clicks on the download button, we take the user to a page where we show a message saying that the book is being rendered and a link will show up here. We then process to poll the backend every, say, 5 seconds and show the download link when it's ready. We'll also have a message for non-JS users to refresh the page to see an updated status message or the download link if it's ready.

@Nirzar thoughts on this ^

Makes sense. I can make a correction in the description. I'm curious - do we know if this was one of the original issues with OCG? As in, was OCG failing while rendering single-page and books (prior to our deployment of Electron)?

Not sure. As you know we inherited these projects and I'm not too familiar with their histories.

Few ideas

Book is ready from user perspective

download.png (1×2 px, 464 KB)

User taps Download

download begin.png (1×2 px, 454 KB)

still creating

download-ending.png (1×2 px, 454 KB)

finished creating, browser download triggers

downloaded.png (1×2 px, 464 KB)

conditional extra messaging, if the number of pages is >30

Artboard Copy 8.png (1×2 px, 425 KB)

same can be used with old UI

old-ui.png (1×2 px, 539 KB)

@bmansurov - do we have a way of estimating page numbers?

We won't know the exact numbers, but we can try and guess based on the HTML size. That won't be accurate though.

hmm...@Nirzar, @bmansurov - maybe the best thing to do then is to establish some sort of threshold for "large" and skip showing an estimate altogether to the user

That's what we agreed on. See the mocks from the description. Yeah, and if a book has more than 20 articles, or some number, then we can consider it large.

oh, nm, I was looking at the old mocks. ignore me.

ovasileva changed the task status from Open to Stalled.Feb 22 2019, 3:30 PM
ovasileva removed a project: Proton.

Stalling until new pediapress renderer is out