For https://github.com/overleaf/issues/issues/4503#issuecomment-873961735
Based on v2.2.228 (d7afb74a6e)
9826c6eb1e)6d118ec35e)pdf.js$ npm cipdf.js$ npx gulp genericpdf.js$ cp build/generic/build/pdf.* build/generic/LICENSE HERE/buildPDF.JS does not properly handle network errors for range requests. Any of the initial probe request or following chunk requests can get the editor stuck.
Once any of the requests has failed, the current pdf.js document is stuck and it's (loading) promise never resolves/rejects. This is in turn breaking the frontend cleanup ahead of switching the pdf. New successful compiles will get queued on top of the stuck promise.
Steps to reproduce:
Alternative reproduction steps involving hacking the ssl-proxy: