Closed lcjohnso closed 1 day ago
Note: the following relevant fields are serialized out into the https://www.zooniverse.org/api/me
response:
"banned": true
"confirmed_at": null
Error from Talk (i.e., not allowed to create this Comment
) could be caught in similar way to this case for the Lab's collaborator page: https://github.com/zooniverse/Panoptes-Front-End/blob/master/app/pages/lab/collaborators/CollaboratorCreator.jsx#L78-L83
Here's a breakdown of everything I'm accounting for.
Possible causes for error states:
Possible avenues for error states:
https://talk-staging.zooniverse.org/discussions
https://talk-staging.zooniverse.org/comments
https://talk-staging.zooniverse.org/conversations
NOTE: if a user is banned, they may not even get the opportunity to reach the possible avenues above, or see the "you are banned" message.
Known error messages/error responses:
{error: "You are banned"}
{error: "You are banned"}
{error: "You are banned"}
{error: "not allowed to create this Discussion"}
{error: "You must confirm your account"}
Shaun TODO: note that when unverified, there are two possible 🟣 🟠error responses. The 🟣 401s return a very generic "nuh-uh" so a helper function should check for user.confirmed_at
.
For all avenues listed above, the affected component is <CommentBox>
(link), at the onSubmitComment's .catch()
(link)
Current behavior
If a user is banned or has an unverified email address (after email verification is deployed -- see https://github.com/zooniverse/talk-api/pull/311), the user is shown an error message when they try to post on Talk:
not allowed to create this Comment
Expected / new behavior
Provide an informative error message that describes the reason why the user was unable to post a comment.
Note Regarding Existing Behavior for DMs:
You are banned
, matching the response payload from the Talk API ({"error":"You are banned"}
).You must confirm your account
, matching the response payload from the Talk API ({"error":"You must confirm your account"}
).Steps to replicate
Try to post using an account that is unverified or banned.