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

Allow users to appear anonymously while spectating games #537

Closed
wants to merge 4 commits into from

Conversation

srstinson
Copy link

@srstinson srstinson commented Mar 1, 2024

Loads the value created in lichess-org/lila#14775 from MongoDB and modifies the table of spectators to store whether that user appears anonymously or not.

Then, when reporting the room status, will add users appearing anonymously to the anon count and remove them from the list of users specified.

User spectating a game anonymously using this setting:

image

The only thing I was not sure about was whether or not to look up the user's preference in MongoDB or have it be sent as part of the call to the websocket. I chose to do the lookup here to decouple the logic more but I can see the extra db call being something we would want to avoid. Another option would be to not care about the user's preference all all while connecting but to handle it when the room's status is requested, but I felt that would lead to an extremely large number of db calls.

@ornicar
Copy link
Collaborator

ornicar commented Mar 1, 2024

Thanks, but I don't agree that the feature is worth the extra code and the performance penalty of adding one database request every time someone watches a game.

@ornicar ornicar closed this Mar 1, 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.

2 participants