Open binarykitchen opened 6 years ago
Btw in the stack trace I can see this happens when queue is drained and Duplexify._destroy
is called.
Can you include that stacktrace?
i am afraid, due to wrong configs, browserify sourcemaps are broken on production, hence this stack trace is kinda cryptic and not very useful:
Error
at Function.VideomailError.create (https://videomail.io/js/main-1000576986.min.js:3:906305)
at null.<anonymous> (https://videomail.io/js/main-1000576986.min.js:3:971808)
at https://videomail.io/js/main-1000576986.min.js:3:735480
at EventEmitter.emit (https://videomail.io/js/main-1000576986.min.js:3:735605)
at Duplexify._destroy (https://videomail.io/js/main-1000576986.min.js:3:727187)
at https://videomail.io/js/main-1000576986.min.js:3:727047
at Item.run (https://videomail.io/js/main-1000576986.min.js:3:778418)
at drainQueue (https://videomail.io/js/main-1000576986.min.js:3:777238)
at arlong:beforeload:6:321
Let us know if you can reproduce this reliably and/or have a better stacktrace.
I'm afraid very hard to reproduce. Happens by random on a heavy traffic site.
Do you have a guess what this could be?
Not really. Did it happen with the latest version of readable-stream? Can you try to roll that back?
how? not using readable-stream anywhere in the videomail-client code
Duplexify is relying on readable-stream internally.
do you recommend to roll back readable-stream by rolling back websocket-stream? cos it's a nested-nested dependency
Did this happen after a very recent deploy? I released a new version a week ago.
no, happened before as well
then no, that's not the problem. We really need a stacktrace and/or a good way to reproduce.
ugh, this will be difficult for me.
is there a useful tool/package to inspect/record a stream of all its events/data it had till the error was emitted?
As far as I can tell websocket-stream doesn't originate any errors itself but does propagate errors from the underlying WebSocket which of course is just a plain TCP socket, so your null errors could be either coming from the ws
module or from the browser or from the operating system's socket implementation.
@Juul @mcollina ok now i always can reproduce this. and it is on iphones only:
i expect websocket-stream to resume but not to throw an error. or at least throw a descriptive error.
I think this is a safari-mobile specific bug. If you can get a stacktrace, we can definitely generate a new error if it's not provided by the platform.
hard to get a stack trace here i am afraid - do you have any other examples running online producing valid stacktraces i could test from my iphone?
You should be able to use Remote Web Inspector.
good idea. turns out it is an event object, not an error object itself.
this screenshot tells more:
when debugging deep down, looks like
function onerror(err) {
stream.destroy(err)
}
is the starting point. and funny is that this
references to the global Window where this.destroyed
is undefined. i expect it to be destroyed when iphone is locked/sleeping.
@binarykitchen let us know if you can send a fix!
dont know if i can.
socket.onerror
<-- what instance is socket here in the browser?
its implementation has to be questioned here.
it's a WebSocket
native implementation?
the WebSocket from the browser.
okay, sounds like it's an ios bug of its websocket implementation ... where to start best?
You should probably work around that in your code.
already have but then, what if other non-ios browsers truly emit an error instead of an event during stream errors? then my app code gets complicated just because of ios weird websocket error handling?
unfortunately yes.
alright :(
... btw have reported to apple as well and will keep you posted here.
In my videomail client code this strange thing sometimes happens: no error object is emited along with the error event.
Like
Don't you agree, it should have an error object? An error without an error is not an error :)