Hi all, I've been working on a tool to identify instances of events registered to the wrong object in uses of some JavaScript event-driven APIs, as part of a research project.
The tool flagged line 216 and line 224 in gui/src/views/Inspect.vue, on the registration of the listeners for close and unhandledRejection respectively.
The reason I believe this is an error is as follows (from looking at the socket.io client API documentation):
the listeners for both these events are registered on the socket created on line 210.
However, close and unhandledRejection are not events on socket.io-client.Socket.
My guess is that close should maybe be disconnect -- since you already have a listener for disconnect I’d guess that the listener for close should just be removed.
Then, for unhandledRejection (which is actually an event on process.Process, my guess is that this should maybe be a listener for reconnect_error or reconnect_failed, which are events on the socket.io-client.Socket.
Hi all, I've been working on a tool to identify instances of events registered to the wrong object in uses of some JavaScript event-driven APIs, as part of a research project. The tool flagged line 216 and line 224 in gui/src/views/Inspect.vue, on the registration of the listeners for
close
andunhandledRejection
respectively.The reason I believe this is an error is as follows (from looking at the socket.io client API documentation): the listeners for both these events are registered on the socket created on line 210. However,
close
andunhandledRejection
are not events on socket.io-client.Socket.My guess is that
close
should maybe bedisconnect
-- since you already have a listener fordisconnect
I’d guess that the listener forclose
should just be removed. Then, forunhandledRejection
(which is actually an event on process.Process, my guess is that this should maybe be a listener forreconnect_error
orreconnect_failed
, which are events on the socket.io-client.Socket.Thanks!