Skip to content

Async_handler crashes when Internet disconnects or connection times out #3239

Open
@ghost

Description

download_failure_retry of emscripten_async_wget2 may not callback due to timeout. And, if the resource loading fails, it cause the Player to crash.

Switching to offline during throttling will result in the following:

index.js:8546 
 GET http://127.0.0.1:8081/ep/games/2kki/Sound/door-hikido.wav net::ERR_INTERNET_DISCONNECTED
index.js:1132 Loading of Map Map0003.lmu failed.
The map was not found.

index.js:52 program exited (with status: 1), but keepRuntimeAlive() is set (counter=3) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)

index.js:175 Uncaught 
RuntimeError: memory access out of bounds
    at index.wasm.Player::UpdateInput(:8081/ep/EasyRPG-Mul…ve/build/index.wasm)
    at index.wasm.Player::MainLoop(:8081/ep/EasyRPG-Mul…ve/build/index.wasm)
    at index.wasm.main_loop(:8081/ep/EasyRPG-Mul…ve/build/index.wasm)
    at callUserCallback (index.js:7136:9)
    at Object.runIter (index.js:7211:11)
    at Browser_mainLoop_runner (index.js:7097:26)

And timeouts are difficult to reproduce. There is a chance of encountering net::ERR_TIMED_OUT (I'm not sure if it's spelled correctly) when the internet speed is extremely slow, which may result in neither download_success_retry nor download_failure_retry being called.

I want to ensure a callback by using emscripten_set_timeout. And add an overlay to display loading status and downloading progress instead of just showing a black screen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EmscriptenWebAssembly/JavaScript port for web browsers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions