Abort signal is not triggered
When I use this code, it doesn't trigger when user disconnects from the worker.
But it shows an error
X [ERROR] Uncaught (in promise) Error: Network connection lost.
in the console somehow.
What's the problem?6 Replies
Is there any other way to detect if user disconnects?
AFAIK, this isn't really possible with Workers, unless you're doing WebSockets or something similar.
Oh...... Okay
I'm wondering, if you race a Promise that resolves in a certain amount of time against a Promise that resolves when aborted, then pass it into a
waitUntil
, it might work?Already using
waitUntil()
to check the state after some delay and the abort callback doesn't get called anywayFrom my own experience workers will continue running until they finish the request, even when the client aborts
Not sure if this is true, but thats the behavior I'm getting