ucsb-cs156-m23 / proj-happycows-m23-10am-4

https://ucsb-cs156-m23.github.io/proj-happycows-m23-10am-4/
0 stars 1 forks source link

Chat message API #68

Closed dscpsyl closed 1 year ago

dscpsyl commented 1 year ago

Overview

In this PR, we implement the MVP for the chat backend. There is a post request where users of a common and admins can post messages, a get for users and admins to get messages, a get for admins to get all messages, including the hidden ones, and a delete for admins to hide messages. Those that do not follow the specifications in #1 are not part of the MVP. They will later be updated to conform.

Tests

Linked Issues

Closes #46

dscpsyl commented 1 year ago

This will result in orphaned records when an admin deletes commons. Define the cascade relationships between commons and chatmessage or add a todo to.

Similarly when a user is deleted, you'll either want to delete the user chats as well or anonymize the userId.

@pconrad Could you advise on this, or let's talk about it on Tuesday? This was a problem that I had in mind but pushed it aside while making the MVP. Ik our goal was to never delete anything, but what should happen when a commons is deleted? Should the chat messages still be available in a separate state, or should they be deleted too? When we delete a user, should their info be deleted as well or also hidden, as this will affect how chat messages are changed? If a user is deleted, should their chat messages still be visible to other players in the commons but just with a "deleted user" tag or something else? For now I will put this as a todo as it doesn't effect the MVP or the additions that I will add over the weekend but we will need to address these relationships before this feature goes public.

Regardless, everyone, take care and stay safe over the weekend! This tropical storm is looking to be a big one!

chriscerie commented 1 year ago

When we delete a user, should their info be deleted as well or also hidden

There's privacy & compliance considerations related to not allowing users to completely remove their data. I'd suggest deleting user info completely.

If a user is deleted, should their chat messages still be visible to other players in the commons but just with a "deleted user" tag or something else?

This is a good cross-team discussion point. Consider prior work - when you delete an instagram account, your comments also get deleted. With discord & github, they get anonymized.

iain801 commented 1 year ago

I think anonymizing would be best, as we are hosting conversations (presumably), and they will not make sense if a user is deleted. Comments make sense to remove, as they do not generally build off one another. But chats, by definition, do.

dscpsyl commented 1 year ago

Closed as combined with #76. However, comments and discussions here still stand and will be referred back to.