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

chore: return an error from the subscribe method for a bad stream #498

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

nand4011
Copy link
Contributor

Make the internal subscribe method get the first message and check it to ensure the stream can be read. Without this, certain topic errors won't be caught until the user attempts to iterate over the topic stream.

Break out of the subscription when it receives a permission or authentication error. These cannot be recovered from, so there is no point in reconnecting. This covers the case of a token that expires while being used to read a topic.

Enable the auth client topic tests covering cases that should return an error on subscribe.

Make the internal subscribe method get the first message and check it
to ensure the stream can be read. Without this, certain topic errors
won't be caught until the user attempts to iterate over the topic
stream.

Break out of the subscription when it receives a permission or
authentication error. These cannot be recovered from, so there is no
point in reconnecting. This covers the case of a token that expires
while being used to read a topic.

Enable the auth client topic tests covering cases that should return
an error on subscribe.
Copy link
Contributor

@pgautier404 pgautier404 left a comment

Choose a reason for hiding this comment

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

LGTM!

@nand4011 nand4011 merged commit b1a56db into main Sep 20, 2023
@nand4011 nand4011 deleted the return-error-from-subscribe branch September 20, 2023 20:28
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.

2 participants