-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: wasm panic catching errors and restoring application state and WebAssembly instance #4901
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4901 +/- ##
==========================================
- Coverage 85.82% 85.80% -0.03%
==========================================
Files 86 87 +1
Lines 31005 31255 +250
==========================================
+ Hits 26611 26817 +206
- Misses 4394 4438 +44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
7a28a52
to
636511a
Compare
…ttyCAD/modeling-app into nadro/4857/wasm-panic-catching-errors
closes #4857
Issue
Rust can panic and we cannot
try/catch
the error in javascsript. Our JS internals brick becausethis.isExecuting
is not set tofalse
. Then thewasm
instance fromnew WebAssembly
bricks even more from ourwbindgen
.Fix
try/catch
blockwasm.ts
andwasm-lib
package.Technical bits
I posted several resource links in the original issue above
wasm
instance, they have a conditional to block thisWebAssembly
memory after it has been initializednew WebAssembly
wasm
since it is a global variable within a file that has no export methodMy only automatic way to detect this and fix it is by reimporting the file into memory and having a wrapper layer that points to that imported data. This means it won't point to the cache of the native import/export.