Skip to content

[Feature: Forum] Improve Live Chat Anonymous Naming#12547

Open
QuackHonk wants to merge 4 commits intoSubmitty:mainfrom
QuackHonk:#11999
Open

[Feature: Forum] Improve Live Chat Anonymous Naming#12547
QuackHonk wants to merge 4 commits intoSubmitty:mainfrom
QuackHonk:#11999

Conversation

@QuackHonk
Copy link
Copy Markdown
Contributor

@QuackHonk QuackHonk commented Mar 7, 2026

Why is this Change Important & Necessary?

Fixes #11999

What is the New Behavior?

Instead of the previous method of inputing user information into crc32 and using that number result to directly choose the base adjective and base name, we instead generate a unique salt for each user using hmac_sha256. We then use both the number result and our original user information to pick out an anonymous username. Various information including th user, their salt, and their username will be stored in the new table classroom_participants. To fix the issue where two people are assigned the same base name,

Before.
image
image

One noun and one adjective

image image As can be seen in the database, both instructor and aphacker are given the same anonymous name. This is not obvious to someone looking through the livechat on the website

After:

image image

one noun and one adjective
image
image
Even though both people are given the same base name, they can be differetiated by their numbers.

What steps should a reviewer take to reproduce or test the bug or new feature?

Our change to HMAC and utilizing salts can be seen in submitty_s26_sample.public.chatroom_participants. Every salt should be unique to each person. Each name should be unique to each person (ibase names can have multiples if we run out of unused base names)

To test all names being filled and adding a new anonymous participant without an error, temporarily reduce the list of adjectives and nouns to 1 each in the file site/app/entities/chat/Chatroom.php. Log in as 2 or more users. even though there is only 1 possible base name, each user should differ by their number (eg. Quick Swan, Quick Swan 2, Quick Swan 3)

Automated Testing & Documentation

Other information

Copy link
Copy Markdown
Contributor

@John-Roy123 John-Roy123 left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! However, while testing your change it appears that now when a new Live Chat is created, the server throws a "TableNotFoundException". This seems to be a result from some of the SQL changes you made.

Image

Please fix this issue so that I can continue reviewing your PR.

@github-project-automation github-project-automation bot moved this from Seeking Reviewer to Work in Progress in Submitty Development Mar 12, 2026
Copy link
Copy Markdown
Contributor

@John-Roy123 John-Roy123 left a comment

Choose a reason for hiding this comment

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

After submitty_install-ing instead of submitty_install_site, the changes work as intended. That is my bad!
When I reduce the number of nouns and adjectives to 1 each and join as a student and an instructor and then later as another student and the names had incremental numbers next to them to indicate each user.

@github-project-automation github-project-automation bot moved this from Work in Progress to Awaiting Maintainer Review in Submitty Development Mar 13, 2026
@GarvitKhandelwal31
Copy link
Copy Markdown
Contributor

Hi @QuackHonk

I have also been working on this same issue (mine PR #12459 ) , so I tried testing your code locally. One thing I was confused on was -
When I join a chat anonymously and then regenerate names, then also it shows the same name.

From my test, regenerate seems to clear cached name/session, but the resulting name can still remain unchanged for a user.
Could you please check if this is intended behavior?

image

@bmcutler bmcutler requested a review from cjreed121 March 15, 2026 05:36
@automateprojectmangement automateprojectmangement bot moved this from Awaiting Maintainer Review to In Review in Submitty Development Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

Improve Live Chat Anonymous Naming

3 participants