drupal-meeting-parser icon indicating copy to clipboard operation
drupal-meeting-parser copied to clipboard

Sometimes it never stops [Processing] even though it's done.

Open chrisfromredfin opened this issue 2 years ago • 3 comments

Looking at the code, near line 120 of scrape.js, I console.log'd the sidebar.scrollTop and sidebar.offsetHeight, and sidebar.scrollHeight and I see the following values:

image

scrape.js:120: 1402.5 705 2108

Unfortunately 1402.5 + 705 = 2107.5 and so is not >= 2108.

What's the right thing here?

Original: let finished = (sidebar.scrollTop + sidebar.offsetHeight) >= sidebar.scrollHeight;

let finished = (Math.ceil(sidebar.scrollTop) + Math.ceil(sidebar.offsetHeight)) >= sidebar.scrollHeight; -or- let finished = Math.ceil(sidebar.scrollTop + sidebar.offsetHeight) >= sidebar.scrollHeight; -or- let finished = Math.ceil(sidebar.scrollTop + sidebar.offsetHeight) >= sidebar.scrollHeight - 1;

??

chrisfromredfin avatar Dec 16 '22 21:12 chrisfromredfin

I'm seeing that as well, sometimes. It seems to be more likely to happen on longer threads. And when it does, the trailing </table> is missing. No big deal to add this manually. If it helps I could probably provide a link to a thread where this happens and can be reproduced.

jurgenhaas avatar Dec 17 '22 09:12 jurgenhaas

FWIW I've been rolling with

let finished = Math.ceil(sidebar.scrollTop + sidebar.offsetHeight) >= sidebar.scrollHeight;

And it's been flawless for me. I'll open a PR.

chrisfromredfin avatar Dec 20 '22 20:12 chrisfromredfin

@chrisfromredfin thanks for this working for me as well.

seantwalsh avatar Feb 09 '23 17:02 seantwalsh

Merged, thanks!

mdlutz24 avatar Jun 06 '24 13:06 mdlutz24