notify inviter of failed invite
context
invites are a way for members of a channel to easily spread the word about it, or provide a way into the channel if the channel is vouched.
right now, the system does not tell the person doing the inviting - "inviter" - which invites were successfully issued and which were not. this is in part to prevent side channel attacks where someone could deduce the members of a channel by inviting them.
however, the current response is confusing and does not tell the inviter which invites were successfully sent and which were not.
behavior
olamina is an admin of the channel "earthseed mutual aid"
sending a single invite
-
when olamina sends an invite to a valid phone number that is not yet a member of the channel:
INVITE +11111234444
-
then she gets a response that says
Successfully invited +11111234444.
-
when olamina sends an invite to a valid phone number that is already a member of the channel or has already been invited:
INVITE +11111234444
-
then she gets a response that says
Error inviting +11111234444. They may have already received an invite to join this channel.
-
when olamina sends an invite to an invalid phone number
+11234
INVITE +11234
-
then she gets a response that says
+11234 is not a valid phone number. Phone numbers must include country codes prefixed by a '+'.
sending multiple invites
-
when olamina sends an invite to a list of valid phone numbers that are not yet members of the channel:
INVITE +11111234444, +11111234445, +11111234446
-
then she gets a response that says
Successfully invited +11111234444, +11111234445, +11111234446.
-
when olamina sends an invite mixed bag of valid/invalid phone numbers:
valid: +11111234444, +11111234445
invalid: +1111
already member: +11111234446
INVITE +11111234444, +11111234445, +1111, +11111234446
- then she gets multiple messages telling her which invites were successful:
Successfully invited +11111234444, +11111234445.
+1111 is not a valid phone number. Phone numbers must include country codes prefixed by a '+'.
Error inviting +11111234444. They may have already received an invite to join this channel.
db error
- when any of the invite operations fail at the DB layer, the sender should receive a separate notification with an error message:
There was an error trying to invite +11111234444. Please try again.