Skip to content

Conversation

@nassero
Copy link
Contributor

@nassero nassero commented Feb 7, 2026

Fixes #456

Motivation

Awaiting client.close() will not properly wait for the client to close before continuing.

Modifications

Return the promise in the close method.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    Fixes existing interaction

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the JS client wrapper so that await client.close() actually waits for the underlying native client shutdown, aligning runtime behavior with the declared TypeScript API.

Changes:

  • Return the underlying native this.client.close() promise from Client.close().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 51 to 53
close() {
this.client.close();
return this.client.close();
}
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a Jest test that asserts client.close() returns a Promise (and can be awaited). The existing tests await client.close() would still pass when close() returned undefined, so they wouldn't catch a regression of this bug fix.

Copilot uses AI. Check for mistakes.
@BewareMyPower BewareMyPower merged commit 6f926d6 into apache:master Feb 11, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client.close() does not return a promise

2 participants