-
-
Notifications
You must be signed in to change notification settings - Fork 21
feat: support multiple handlers for a single subscription #66
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
feat: support multiple handlers for a single subscription #66
Conversation
35d3de5 to
c3871a7
Compare
|
Hey @jonahsnider! ππ» Sorry for the delayβwe totally missed this issue. π I've pushed some changes so the tests can run properly. Now, we just need to update them so they pass with this PR since they were failing before. Also, I don't think this change is breaking since it adds a feature that wasn't possible before. We throw an error when people tried to do this, so there might be some users expecting that error in their application. What do you think, @thetutlage? |
|
Hey! No worries with the delay, thanks for taking a look now. I just pushed a change to fix the failing tests, let me know if there are more cases that should be added to the suite. Your point about users maybe expecting the error to be thrown is a little spooky, but hopefully that's not a common use case? Would probably be a good idea to add a callout in any release notes just in case. |
tests/redis_connection.spec.ts
Outdated
| }) | ||
|
|
||
| test('throw error when subscribing to a channel twice', async ({ cleanup }) => { | ||
| test('do not throw error when subscribing to a channel twice', async ({ cleanup }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead write an assertion that both the handlers are being called?
tests/redis_connection.spec.ts
Outdated
| }) | ||
|
|
||
| test('throw error when subscribing to a pattern twice', async ({ cleanup }) => { | ||
| test('do not throw error when subscribing to a pattern twice', async ({ cleanup }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good. Just left a comment to adjust the tests π
Thanks for the review! I just pushed a change which updates the tests based on your feedback. LMK if anything else should be adjusted. |
|
Looks good! Thanks for the PR :) |
|
Thanks! |
π Linked issue
Closes #65
β Type of change
π Description
Allows adding multiple handlers to a single channel subscription.
The old API will still work. A new API was added for removing specific handlers without fully unsubscribing from the channel:
To avoid introducing any breaking changes, the errors in
errors.tswere marked@deprecated, since they are no longer relevant with the introduction of this feature.π Checklist