BUGFIX: user cannot be admin and subscriber at same time
Bug description
- SYMPTOM: alice, who is an admin, sends HELLO. subsequently receives 2 copies of all messages. (and still receives messages after sending GOODBYE, but cannot send them)
- CAUSE: we relay messages to all subscribers and admins. after HELLO, alice is both, so receives messages twice. (GOODBYE removes alice as admin, not subscriber)
- FIX: only allow a user to be an admin or a subscriber, never both
Implementation Notes
- for all HELLO messages, if user is already an admin (or subscriber) block command and respond with helpful "i can't do that" message
- if a subscriber is ever made an admin (via ADD command), delete their subscription record
- backfill any double admin/subscribers to make them admins only
- now: admins should not receive dupe messages and GOODBYE will be unambiguous
Edited by aguestuser