Skip to content

Different behavior calling .end() on a non connected Client between 7.17 and 7.18 #2108

Closed
@InExtremaRes

Description

@InExtremaRes

Calling client.end() on a Client not connected in pg@7.17.1 fails with an error message

Socket is closed

However in pg@7.18.1 the same call just hangs indefinitely. I'm using the promise-based call (without the callback) and awaiting the promise to fulfil.

Is this an expected change?

If the context matters, I have a wrapper around a Client and I'm "unit testing" that a call to its closing function throws if the wrapped client is not connected. Before I was just calling .end() on the inner client but now the test fails since the promise never fulfilled.

If the change is expected, is there a way of knowing if a given Client is connected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions