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: fixes channel occupancy value not populate properly #968

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

andreahaku
Copy link
Member

Explanation

Fixes channel occupancy value not populate properly on Redis

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@andreahaku andreahaku self-assigned this Jul 26, 2024
@andreahaku andreahaku requested a review from a team as a code owner July 26, 2024 15:35
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.69%. Comparing base (ee26cba) to head (a713240).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #968   +/-   ##
=======================================
  Coverage   86.69%   86.69%           
=======================================
  Files         177      177           
  Lines        3863     3863           
  Branches      949      949           
=======================================
  Hits         3349     3349           
  Misses        514      514           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ecp4224
ecp4224 previously approved these changes Jul 26, 2024
let channelOccupancy = 0;
const now = Date.now();

// Decrement the number of clients in the room
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Decrement the number of clients in the room
// Grab channel occupancy if available

const channelOccupancy =
(await pubClient.hget('channels', channelId)) ?? undefined;

const sRedisChannelOccupancy = await pubClient.hget('channels', channelId);
Copy link
Collaborator

Choose a reason for hiding this comment

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

So this can be either a JSON string or a number (old format)? This function assumes this will always be a number. Does this code path need to handle both cases like the other places?

Copy link

sonarcloud bot commented Jul 30, 2024

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.

4 participants