Skip to content

Fix: Use initialized mix fetch instance on Android#714

Open
bobbythelobster wants to merge 4 commits intoEdgeApp:masterfrom
bobbythelobster:fix/nym-mix-fetch-android-panic
Open

Fix: Use initialized mix fetch instance on Android#714
bobbythelobster wants to merge 4 commits intoEdgeApp:masterfrom
bobbythelobster:fix/nym-mix-fetch-android-panic

Conversation

@bobbythelobster
Copy link

Fixes the mix fetch panic on Android by storing and using the initialized IMixFetch instance returned from initMixFetch() instead of discarding it.

The @nymproject/mix-fetch library now handles concurrency natively,
so the custom per-host serialization queue is no longer needed.
queueMixFetch is now a thin pass-through to mixFetch.

Made-with: Cursor
Remove the queueMixFetch wrapper from util/nym and call mixFetch
inline at browser and react-native NYM call sites.

This follows PR feedback and reduces unnecessary abstraction
while keeping initMixFetch setup behavior unchanged.
The initMixFetch() function returns a properly initialized IMixFetch instance,
but the code was discarding it and calling the raw mixFetch() function instead.
On Android, the raw function uses an uninitialized WASM context, causing a panic.

Fix: Store and use the returned IMixFetch instance in both react-native-io and
browser-io fetch handlers.

Fixes the 'panic: JavaScript error: mix fetch hasn'\''t been initialised' error
on Android while keeping it working on iOS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants