Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clients can be sent an Error message after cancellation. #539

Closed
divanise opened this issue Feb 21, 2024 · 2 comments · May be fixed by a11ywatch/core#429
Closed

Clients can be sent an Error message after cancellation. #539

divanise opened this issue Feb 21, 2024 · 2 comments · May be fixed by a11ywatch/core#429
Labels
enhancement New feature or request released Has been released and published

Comments

@divanise
Copy link

From examining the code handling the Subscribe message, it looks like it is possible for a custom async onOperation callback or schema function to delay long enough for a client to cancel the subscription before either returns. If that happens and an error occurs before the subscription starts, the server will still send an Error message for that stream.

One obvious fix is to include a notifyClient parameter to the error function on the emit object, to match how the complete function works.

@enisdenjo enisdenjo added the enhancement New feature or request label Mar 27, 2024
enisdenjo pushed a commit that referenced this issue Mar 27, 2024
# [5.16.0](v5.15.0...v5.16.0) (2024-03-27)

### Bug Fixes

* **server:** Return all subscriptions regardless of the return invocation order ([f442288](f442288))
* **server:** should not send error messages if socket closes before onSubscribe hooks resolves ([db47a66](db47a66)), closes [#539](#539)

### Features

* **server:** Close code and reason are optional ([6ae6e6f](6ae6e6f)), closes [#547](#547)
@enisdenjo
Copy link
Owner

Each of the handler implementation in use/* have a check whether the socket is open before sending any messages. Nevertheless, I've added a fix in the server itself as well. It's released in v5.16.0.

@enisdenjo
Copy link
Owner

🎉 This issue has been resolved in version 5.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released Has been released and published
Projects
None yet
2 participants