polyphony-chat / chorus

A Rust library for interacting with multiple Polyphony- and Spacebar-Compatible instances at once.
https://crates.io/crates/chorus
Mozilla Public License 2.0
16 stars 7 forks source link

Fix gateway heartbeat on WASM #460

Closed kozabrada123 closed 7 months ago

kozabrada123 commented 7 months ago

It turns out std::time::Instant::now() panics WASM (see #459) and breaks the heartbeat handler.

This pr attempts to fix that by replacing std::time::Instant with wasmtimer::std::Instant and safina_timer::sleep_until with wasmtimer::tokio::sleep_until.

kozabrada123 commented 7 months ago

Maybe, though I think the time needed to get a disconnect if heartbeats don't work is too long for a test