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

Fix PubSub isActive with Sharded PubSub #2476

Merged
merged 1 commit into from Apr 24, 2023

Conversation

sorilove
Copy link
Contributor

@sorilove sorilove commented Apr 19, 2023

Missing PubSubType.SHARDED and duplicate comparison of PubSubType.CHANNELS when comparing listeners size in updateIsActive function

Description

When calling the sunsubscribe function, the isActive information is incorrect and the redis client is forcibly disconnected.
In the updateIsActive function, we found that PubSubType.SHARDED was missing where the size of listeners is compared.
The listeners size of PubSubType.CHANNELS is being compared twice.
We fixed the issue and verified that sunsubscribe is working properly.


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

Missing PubSubType.SHARDED and duplicate comparison of PubSubType.CHANNELS when comparing listeners size in updateIsActive function
Copy link
Collaborator

@leibale leibale left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, I was on vacation...

LGTM :)
Thanks for contributing!

@leibale leibale changed the title Fixed a bug in the updateIsActive function Fixed PubSub isActive with Sharded PubSub Apr 23, 2023
@leibale leibale changed the title Fixed PubSub isActive with Sharded PubSub Fix PubSub isActive with Sharded PubSub Apr 23, 2023
@codecov-commenter
Copy link

codecov-commenter commented Apr 24, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.03 ⚠️

Comparison is base (d65a641) 95.63% compared to head (5bcb507) 95.60%.

❗ Current head 5bcb507 differs from pull request most recent head de94a43. Consider uploading reports for the commit de94a43 to get more accurate results

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2476      +/-   ##
==========================================
- Coverage   95.63%   95.60%   -0.03%     
==========================================
  Files         455      455              
  Lines        4579     4548      -31     
  Branches      528      520       -8     
==========================================
- Hits         4379     4348      -31     
  Misses        129      129              
  Partials       71       71              
Impacted Files Coverage Δ
packages/client/lib/client/pub-sub.ts 79.85% <ø> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@leibale leibale merged commit 9f2e27d into redis:master Apr 24, 2023
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.

None yet

3 participants