You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support some synchronous Fetch API calls with the wasm backend, without a fetch-worker (#9490)
@dschuff looked into this and found that we can only use the fetch-worker to
help with synchronous fetches when we are in a worker, since the main thread
can't block on another one. But if we are in a worker, then we can just do a
sync xhr directly!
Thanks to that we can enable test_fetch_sync_xhr_in_wasm, so this helps #7024,
but it does not fix all the cases. There is still emscripten_fetch_wait, and I
believe some IDB operations may also not work. I noticed that some fetch test
coverage may be misleading here, as we skip browser tests that use WASM=0 with
pthreads (since wasm2js doesn't support that); I added an explicit skip to the
test for emscripten_fetch_wait to make things clearer.
This gets rid of a block of code starting with Should we try IndexedDB first?.
That code seems unnecessary: It checks if we will need IDB and then errors if
we will but it isn't ready. However, the actual operation later would error on
missing IDB anyhow, so this is redundant. Worse, it looks wrong to me, as it
says a simple fetch should use IDB but that doesn't seem right - in particular,
it made the test here fail. Regardless, just removing the code seems best.
logger.warning('Bug/TODO: Blocking calls to the fetch API do not currently work under WASM backend (https://github.com/emscripten-core/emscripten/issues/7024)')
0 commit comments