Description
Hi! The SDK uses the Connection class as its default class and it extends EventEmitter
. However, it does not actually behave like one as it does not emit any event, errors included. For instance, in heartbeat request errors, the SDK just logs them instead of emitting them. Shouldn't we be emitting internal errors through the EventEmitter
API? If not, why inherit it at all?
For a concrete example of how the lack of error event emissions is a bit confusing, it created an issue on our end as we're using a Knex SF dialect to manage a connection pool and it relies on error events to dispose a connection (can be seen here). Since the SDK does not emit these events, the connection will stay in the pool even though it shouldn't since it is not usable. In the end, the connection was in a disconnected state and we ended up getting countless Unable to perform operation using terminated connection
errors.
It would be great if the class would forward the errors so the users can handle them!
Activity