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
Today, it is possible to end up with a case where, because of delayed execution, the error emitter is assigned after some of the error-emitting code has started to execute.
Though this example is a bit contrived, it is easy to picture a more organic scenario where the code is "synchronous" ish, but is triggered in an asynchronous manner, thus not being executed before any other async logic.
We should investigate the possibility of moving the error emitter assignment so that it is possible to do before doing the initial commit.
An example, though not the final design, of such a solution, might be something like:
I can see that this might cause issues, due to the delayed evaluation of the code adding an error handler. It's worth noting though, that although this might be confusing to users, I would suggest to firstly improve communication regarding error handling (through examples and documentation). This particular case is solvable in a quite trivial manner: ensure to add listeners synchronous (or perhaps more clearly, in the same "tick" as the .connect() invocation.
As I would say this is something I consider quite idiomatic JavaScript/Node, I'm not sure I agree that additions to the API is the right course of action.
Today, it is possible to end up with a case where, because of delayed execution, the error emitter is assigned after some of the error-emitting code has started to execute.
Example of delayed emitter assignment
Though this example is a bit contrived, it is easy to picture a more organic scenario where the code is "synchronous" ish, but is triggered in an asynchronous manner, thus not being executed before any other async logic.
We should investigate the possibility of moving the error emitter assignment so that it is possible to do before doing the initial commit.
An example, though not the final design, of such a solution, might be something like:
The text was updated successfully, but these errors were encountered: