haystack / murmur

A mailing list designed to reduce noise and encourage sharing
25 stars 13 forks source link

Handling when a user tries to unsubscribe from a mailing list they created #284

Closed soyapark closed 4 years ago

soyapark commented 4 years ago

Assigned to @raxelg

Copying from previous Raxel's heuristic evaluation https://github.com/haystack/murmur/issues/283

One possible user flow is 1) if there is another admin, they can unsubscribe from the list. 2) if they are the only admin, we should give warning that "if you unsubscribe from the list, it will remove this mailing list".

Before implementation, please suggest mock-up or plans.

raxelg commented 4 years ago

@soyapark I agree with the user flow. Since the model does not keep track of who created the mailing list, the only scenario where this is an issue is if the user unsubscribing is the last remaining admin. So I can check this condition.

Update: I will be storing the number of admins in the mailing list in the group_info object passed to the html where I will store the value in a hidden

element. I will reference that value in the jQuery to either allow the user to unsubscribe if there is more than one admin, else I will send an alert message telling the user to either delete the group or make another person admin and then unsubscribe. I prefer this behavior over having an option to delete the database in the alert message because unsubscribing from the mailing list is much different from deleting the mailing list so to make sure they want to delete it, they should press the delete button.

soyapark commented 4 years ago

Update: I will be storing the number of admins in the mailing list in the group_info object passed to the html where I will store the value in a hidden element.

Why don't you query the number rather than storing the number upfront? What if every other admin already unsubscribe after the user loads this page? Using your algorithm, the stored data will be more than 1, so it will let the user to unsubscribe but it shouldn't or give them warning. Instead, whenever an admin tries to unsubscribe from the group, you can query db to find the current number of admins in this group on demand . This way, it will be more up-to-date.

raxelg commented 4 years ago

I see what you're saying I will query the db, thanks!