Closed orausch closed 6 months ago
This is really strange behaviour. I wasn't able to replicate it and some of the guard rails in ChunkedStream
should have prevented this, but I don't mind adding in your change as a sanity check.
Only change I made was >=
to >
, so we can include 100% progress directly. I'm not aware of any duplicate interleavings, so hopefully this still works.
Thanks for the contribution!
Thanks for the great fork.
I ran into a race on pdf loading, the bad interleavings are something like:
The
Setting to null
log line is right before this line: https://github.com/orausch/react-pdf-highlighter-extended/blob/main/src/components/PdfLoader.tsx#L85The loaded printouts are just the
onProgress
hook.Notice that the onProgress hook gets called again afterwards, which sets the UI back into the loading state, and freezes it there. Interestingly it's greater than the total, which I traced back to this line in the pdfjs worker: https://github.com/mozilla/pdf.js/blob/29faa38dd78d319ac99ab35aed7e659f3b070f4f/src/core/chunked_stream.js#L530