vocatwk / CodeU-Nemo

Chat web app for CodeU
Apache License 2.0
1 stars 3 forks source link

Notification System Higher design #54

Open jasminechau2 opened 6 years ago

jasminechau2 commented 6 years ago

Implementing a notification system that sends a user notifications about events happening on the website. Should it include the addition of new users? Notifications about messages to a conversation? Notifications to conversations created?

yebrahim commented 6 years ago

This is a good start. Can you brainstorm some ideas to the questions you added, and maybe these as well? :)

jasminechau2 commented 6 years ago

Interactive notifications would be great. Last seent notifications would be beneficial to the user and I would want to implement the notification system in this manner. I think to have notifications for messages is needed, but if we can find a way to get notifications on of created conversations that the user is interested it in it would be beneficial as well.

yebrahim commented 6 years ago

Ah, you mean something like a "subscribe" feature to a conversation, so that you get a notification for each message? That can be useful!

For the basic notifications though, what exactly do you think that users should be notified about? Every message, @ mentions, friends logging in and out... etc?

Also, are notifications grouped by conversations? In other words, do I get one notification per conversation, regardless of how many new chats are in that conversation, or do I get as many notifications as new messages?

jasminechau2 commented 6 years ago

Yes, a subscribe function! I didn't think of that but I like it! I was thinking per message for right now. We do not have an @ method currently or a friends function so for the mvp I would want to to do messages. For your second question, I would probably want to send a notification for every new message in a conversation.

yebrahim commented 6 years ago

Now that you've merged the prototype, let's think about the next logical step.

How about adding a "lastSeenNotificationsTimestamp" field to the User class, which we keep updating every time the user visits the notifications page? If we do this, then getting the list of notifications for any user is a matter of querying the datastore for all notifications newer than the value in this field.

Thoughts?

jasminechau2 commented 6 years ago

I like this idea. For implementing a notification class I want to take the name of the user sending a message and the receiver. Also, would it be beneficial to find if notifications are seen, it may help with deleting old notifications off the notification page.

jasminechau2 commented 6 years ago

Could I use the events class as the notifications, because the events store information about content, time created and the user who made the event, or should I create a class independent of other classes?

yebrahim commented 6 years ago

I don't see a lot of value in a new Notification class, since we already have the EventStore, which can return the list of all events. We can modify it to return only the list of events since a specific date, then those are what we display to the user on the notifications page. This is assuming we add the timestamp field to the user.

I'd say we should keep the first step simple and not allow the user to clear notifications.

For the next step, if we want the user to clear notifications, how about we add one more field to the Event class to indicate whether this event has been seen/cleared by the user?

But let's approach this step by step, and only work on the first piece for now to scope things down. Let me know what you think. :)

jasminechau2 commented 6 years ago

That could work, I was wondering how we would get specific notifications for a user as it would not be beneficial for the user to receive a notification for every event made.

lealgamb commented 6 years ago

Really like these ideas 😃. @jasminechau2 That might be something that a subscribe function can be useful for in the future. For now getting a notification for every event is probably okay, then once the subscribe function is added we can filter the events.