Skip to content

v0.4.3

Choose a tag to compare

@proggeramlug proggeramlug released this 24 Mar 04:11
· 4602 commits to main since this release

fetch().then() callbacks never fire in native UI apps

Fixes #6

The bug

In native macOS/iOS UI apps, fetch() network requests completed successfully but .then() callbacks never fired. The same issue affected WebSocket, bcrypt, zlib, ioredis, and any other stdlib function using the bare spawn() helper.

Root cause

spawn() in async_bridge.rs was missing a call to ensure_pump_registered(). Without it, js_run_stdlib_pump() — called by the UI framework's timer — was a no-op. Resolved responses accumulated in PENDING_RESOLUTIONS but were never drained back to JavaScript.

The two other spawn variants (spawn_for_promise and spawn_for_promise_deferred) already called ensure_pump_registered(), so only callers of the bare spawn() were affected.

The fix

One line: added ensure_pump_registered() to spawn(). Uses std::sync::Once internally, so zero overhead after the first call.

Affected stdlib functions

fetch, WebSocket, bcrypt.hash/compare/genSalt, zlib.deflate/inflate, ioredis (all commands), http.request, cron