Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

[FIX] Active users count on `@all` and `@here`

Open LucianoPierdona opened this issue 3 years ago • 1 comments

Proposed changes (including videos or screenshots)

this PR updates the old roomMembersCount to count active users instead of everyone

Issue(s)

Steps to test or reproduce

Further comments

LucianoPierdona avatar Jun 22 '22 12:06 LucianoPierdona

Codecov Report

Merging #25957 (6257d93) into develop (0ba7bbc) will increase coverage by 0.04%. The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #25957      +/-   ##
===========================================
+ Coverage    38.65%   38.70%   +0.04%     
===========================================
  Files          792      792              
  Lines        18892    18894       +2     
  Branches      1937     1937              
===========================================
+ Hits          7303     7313      +10     
+ Misses       11300    11294       -6     
+ Partials       289      287       -2     
Flag Coverage Δ
e2e 38.70% <75.00%> (+0.04%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

codecov[bot] avatar Aug 08 '22 14:08 codecov[bot]

so, I remembered we have a property called __rooms in IUser, this fields stores every room ID the user is joined, except DMs.. since this field is indexed, it can be used to achieve the same results without the need to use $lookup from Subscriptions..

btw, my previous comment is still valid, this is just another solution that is easier to implement.. I think we should get rid of the __rooms field in the future.. in the meantime, we can use it for this.

sampaiodiego avatar Aug 22 '22 14:08 sampaiodiego

so, I remembered we have a property called __rooms in IUser, this fields stores every room ID the user is joined, except DMs.. since this field is indexed, it can be used to achieve the same results without the need to use $lookup from Subscriptions..

btw, my previous comment is still valid, this is just another solution that is easier to implement.. I think we should get rid of the __rooms field in the future.. in the meantime, we can use it for this.

Query updated!

LucianoPierdona avatar Aug 22 '22 19:08 LucianoPierdona