-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Member Counts Inaccurate in Parties #12275
Comments
I'm changing this to suggestion-discussion because @paglias has raised load-related concerns about the desired fix (which was developed from an old comment in the old issue) and I don't want a contributor starting on it if it's decided we don't go ahead with it. :) |
In the meantime if the issue affects mostly parties where the member count is more important (due to the limit of 30 members) we could recalculate the number of members just for them excluding guilds |
OK, I'm updating this ticket to relate to Parties only, and will spin off a separate ticket for Guilds that we'll leave on hold pending the ability to use transactions. |
Following on from an initial question about this issue in Aspiring Blacksmiths: From memory, there's already code for recomputing memberCount ( |
Hi, can someone please assign this issue to me. I do have general programming experience and I would like to work on this as my first issue. I will go through the issues mentioned here, start working on this issue and post any doubts here. Also, will it possible to inform where do I need to look in the code for this change? |
As per my understanding, we have to change how the number of members is calculated. I was unable to determine which section of code recomputes it (as pointed out by @Alys ). There is not separate end-point like The
Can someone please guide me in a correct direction? |
@JalanshMunshi I'm sorry about the delay! I've marked this as in progress for you. The issue is that when people join or leave a group, the group's To minimise that problem for parties, we want to change how Does that clarify the issue? Please post again if not! |
@JalanshMunshi Look for uses of |
Thanks for the help, @Alys, and @SabreCat ! Can you please review my draft PR? I get the existing However, please confirm this from your end as well. Please point out if I am missing anything or making any mistake in the draft PR. Some doubts from my end:
The first one is related to challenges. As per my understanding, we do not have to make any changes there. However, I am not sure about the second one. Can you please provide confirmation for both my doubts? |
Good questions! My personal opinion about the tests is that you're probably correct that they don't need to be updated, but if Habitica's staff say otherwise, listen to them not me. :) You're right that the code for challenges doesn't need to be modified for this issue. Challenges do suffer from the same memberCount problem as groups but the consequences are less severe, so there's no point us trying to fix Challenges until database transactions are available. The *.vue files such as membersModal.vue contain only client-side code, so any modifications to memberCount made in them are only to give the player instant feedback for their action to add/remove a member. It doesn't matter if that code is inaccurate because the next time the player loads the page, the correct value that's stored in the database will be displayed. |
@Alys is right, I would not update tests as there are already tests covering the changes in |
…ixes #12275 (#12308) * Changed the way how memberCount is incremented or decremented. * Updated the logic for incrementing/decrementing memberCount for parties and guilds. * Fixed lint errors * Added relevant comment. Changed the way how memberCount is updated to replace the usage of custom query. * Fixed lint errors. * Reverted changes owing to failing tests. * Added relevant comments. Removed duplicate and unwanted code. Added await for async function call. * Minor change due to lint error. * Reverted changes for removing the party member when the menber leaves.
Description
Clean-up of #7454. You can visit that ticket to see the full history of discussion on this issue.
memberCount
in group records is a stored computed value that we currently attempt to keep up to date by incrementing and decrementing as members join and leave. It frequently gets out of sync, leading to people with 6-member parties showing a member count of 7, etc.; this is a nuisance at best, and in some cases involving the 30-person party limit, can actually interfere with people joining or inviting members.This is the desired fix:
...when Parties are involved. At this time, we're leaving Guilds alone for performance reasons. See #12286 for the status of that arm of the issue.
The text was updated successfully, but these errors were encountered: