-
Notifications
You must be signed in to change notification settings - Fork 263
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
'not in a browser' panic when encrypting with wasm under node.js #1443
Comments
I think we can remove the logic, it's not used anywhere outside of a unit test in EA. We might want to solve the unit test problem with some other way. |
which logic? The timeout? |
Yep the timeout, specifically this part of the backtrace is the source of the panic:
So I propose we remove the whole |
I'm fine removing it if nobody else is using it. |
I discussed this a bit online with @poljar. My feeling was that the Accordingly: my preference is to fix the timeout rather than throw away the whole of |
The timeout we're talking about can be found here: matrix-rust-sdk/crates/matrix-sdk-common/src/timeout.rs Lines 33 to 37 in 6a5fa81
It uses the |
It's raised from https://github.com/tomaka/wasm-timer/blob/64c812a69981cbf0bc428d290a7887818f451e2d/src/wasm.rs#L59. Node.js has no global |
Yes. Possibly we could use https://crates.io/crates/gloo-timers which AFAICT just calls the standard global |
when calling
OlmMachine::encryptRoomEvent
from ajest
test environment:It looks like we're calling
wasm_timer::TryFutureExt::timeout
, which seems to be problematic when used outside the browser due to the lack of awindow
object (and, for that matter, when used in web workers). See also tomaka/wasm-timer#21 (comment) which suggests that wasm_timer needs replacing anyway.Possibly also related: #896.
The text was updated successfully, but these errors were encountered: