Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1583 +/- ##
===========================================
- Coverage 87.13% 87.13% -0.01%
===========================================
Files 392 392
Lines 89280 89283 +3
Branches 5080 5080
===========================================
+ Hits 77794 77795 +1
+ Misses 11486 11467 -19
- Partials 0 21 +21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds more support for handling errors when starting up the SRE webworker. It turns out that in some settings (due to security settings) WebKit fails to load the webworker in a way that isn't currently being caught, leading to the startup promise not being settled. In addition, new promise-based requests to typeset additional material on the page also fail to resolve.
We address both these issues here. In
a11y/speech/WebWorker.ts, we add anonerrorhandler to the webworker that detects the failure to start up, and call theFailed()command in that case, which triggers the worker to be shut down and any pending tasks to be rejected. (This resolves the first issue above.) We add a newstoppedproperty that indicates that the worker has been stopped, so that no new tasks are rejected immediately by thePost()command. (This resolves the second issue above.)It turns out that the calls to the
Failed()command were not passing a properMessageobject but rather a string, so that has been fixed by using{error: message}rather than justmessageas its argument. (Typescript didn't catch this because of the indirection involved in calling the function.) This required changes in the DOM adaptors.In addition, the
onerrorhandler needed to be added to theminWorkerinterface, so we could use it inWebWorker.ts, and so we needed to add it to theLiteWorkerin theNodeMixin.tsfile.Finally, the source of the problem in WebKit is that the
blobURL created for the webworker bootstrap code doesn't work in an origin-less setting (like the one described in mathjax/MathJax#3620), but adata:URL would work. SoHTMLAdaptor.tschecks forwindow.origin === 'null'and uses adata:url in that case rather than the blob. This makes the code in the initial issue report run properly in Safari as well.Resolves issue mathjax/MathJax#3620.