Page MenuHomePhabricator

Better error handling if clicking "Thank" fails in some way on Structured Discussions
Open, Needs TriagePublicBUG REPORT

Description

What is the problem?

If a user is blocked specifically from sending thanks, there is some undesirable UI behaviour on Structured Discussions pages.

  1. After clicking "Thank", the error popup is not very informative. It says: Thank action failed (error code: blocked). Please try again.
    flow-thank-block-message.png (387×1 px, 58 KB)
  2. After refreshing the page, "Thank" becomes "Thanked", even though the thank was not successfully sent
    flow-thank-block-afterwards.png (390×1 px, 28 KB)
    • I think this is just stored in cookie/browser storage. After I cleared cookies and cache it became "Thank" again.

I raised T283720 to remove the "Thank" link entirely when the user is blocked. However, this issue might still exist if the user has other errors while trying to send thanks.

Observed while testing T242785#7106962.

Steps to reproduce problem
  1. Login as an admin user
  2. Go to Special:Block/$user (for a $user you can login as)
  3. Uncheck "Editing" and check "Sending thanks"
  4. Select an expiration time and submit the form
  5. Login as $user
  6. Go to any Structured Discussion page
    • (You might need to go to Special:Preferences#mw-prefsection-betafeatures and enable it on your own user_talk page)
  7. Underneath replies from other users, click the "Thank" link

Expected behavior: An informative error message, in this case including information about the block effecting the user, such as was done in T270803
Observed behavior: Thank action failed (error code: blocked). Please try again.

  1. Refresh the page

Expected behavior: The link still states "Thank"
Observed behavior: The link states "Thanked"

Environment

Wiki(s): https://en.wikipedia.beta.wmflabs.org Thanks 1.2.0 (ca5b333) 07:55, 24 May 2021