[FIX] Subscriptions not removed when removing user#9432
Conversation
Bypass the cache and find the subscriptions directly from database to prevent the in memory changes while deleting. The for each of the array in memory does not works cuz the array is changing the size.
|
@rodrigok what do you think about a migration which removes inconsistent subscriptions? While the fix prevents new issues, the obsolete subscriptions are aasige problem in existing installations. |
|
@mrsimpson Sure, but I don't think it should be a migration, I'll see how we could create and admin option to run the consistency fix, so I'll merge this now. Thanks |
|
Once this is pushed into stable builds will this fix the existing problems for people affected by this bug? |
|
This will only keep the problem from effecting new cases, does not fix the ones that have already had this happen |
|
@geekgonecrazy Hi. It seems I have that problem with some users. Is there a fix for existing cases? |
|
you could likely write a mongo query to do something like: Then from there you could loop over if your problem is instead that you have subscriptions hanging around in your channel list for users that are no more... you could use same loop. Instead take |
|
@geekgonecrazy thank you for your reply, but this query finds 0 entrys. Maybe my problem is different to the one in this thread? |
|
Did user1 at any point delete their user and then create an account with the exact same username? |
|
Yes. the User was deleted and recreated once iirc. |
Bypass the cache and find the subscriptions directly from database to prevent the in memory changes while deleting.
The for each of the array in memory does not works cuz the array is changing the size.
@RocketChat/core
Closes #6535