Page MenuHomePhabricator

Duplicate thank you allowed
Closed, DuplicatePublic

Description

It's fun to be thanks for a revert by the reverted editor, but not two times.
See attachment 12003.


Version: master
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=51303
https://bugzilla.wikimedia.org/show_bug.cgi?id=61883

Details

Reference
bz46690

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:28 AM
bzimport added a project: Thanks.
bzimport set Reference to bz46690.
  • Bug 46820 has been marked as a duplicate of this bug. ***

There are 2 different ways we could solve this without spamming the database:

Client-side:
When the ajax request for the thanks action completes, store the rev_id in a session cookie. When the history or diff page is loaded, have it check against the rev_ids in the user's session, and set the links appropriately (either a non-linking 'thanked' or a linked 'thank').

Server-side:
When the Thanks API completes the thank action store the rev_id in the user's memcached store. In the insertThankLink hook, check the memcached store for that rev_id and set the links appropriately.

swalling wrote:

(In reply to comment #2)

There are 2 different ways we could solve this without spamming the database:
Client-side:
When the ajax request for the thanks action completes, store the rev_id in a
session cookie. When the history or diff page is loaded, have it check
against
the rev_ids in the user's session, and set the links appropriately (either a
non-linking 'thanked' or a linked 'thank').
Server-side:
When the Thanks API completes the thank action store the rev_id in the user's
memcached store. In the insertThankLink hook, check the memcached store for
that rev_id and set the links appropriately.

The session cookie storage solution isn't permanent, but it prevents immediate duplicates by confused users who have refreshed the page or hit Back/Forward. This is a pretty critical enhancement, so even if that's not perfect, getting something out soon to fix this should be a priority IMO.

Relatedly: can I un-thank someone?

MZMcBride: No, there's no way to un-thank. Keep in mind that all notifications can also send emails (if users opt into it), and there's no way to unsend an email (not counting Microsoft Exchange).

Related URL: https://gerrit.wikimedia.org/r/60914 (Gerrit Change I976cd8fbf00856c67b77daeb0d0a952efb371661)

(In reply to comment #4)

Relatedly: can I un-thank someone?

The general Thanks workflow is being discussed at bug 47658.

(In reply to comment #5)

MZMcBride: No, there's no way to un-thank. Keep in mind that all
notifications can also send emails (if users opt into it), and there's no way
to unsend an email (not counting Microsoft Exchange).

I think we all understand that. The question is, what is the immediacy to send the email in the first place? Would it be much of a load on the system to hang on to the thank for 30-60 seconds before sending the email to offer that amount of time to realize the error and undo it?

I believe I double thanked Scott Martin the other day for https://en.wikipedia.org/w/index.php?title=User_talk:Technical_13&diff=594071365&oldid=594071255

I thanked him once from the page history, once from the revision history (comparison page), and I actually just thanked him again from the page history (which shows up https://en.wikipedia.org/w/index.php?title=Special:Log&type=&user=Technical_13&page=User%3AScott_Martin&tagfilter=&hide_patrol_log=1&hide_review_log=1&hide_thanks_log=0 ).

So, I'm not sure if it is a lack of the ability for the system to know that I've already thanked for this edit (bug 49087) and if so, it should be a new ticket, or if it was an oversight as part of this bug and as such I've reopened this bug hoping for advice.

@Technical 13: According to the logs you did not double thank Scott on the same day. You thanked him once on the 22nd and once on the 24th. The second thanks must have either been for a separate revision of performed during a separate session. Otherwise, it would not have been successful. Thanking someone twice for the same edit from two separate sessions takes a very conscious effort on the part of the thanker, so I'm not sure there is any real bug here. Preventing all possible stupid actions from editors via software is a sure way to make your software bloated and unmaintainable. For example, we could prevent users from sending the same email message to the same user twice, but that would be pretty silly.

Scott added a comment.Feb 24 2014, 9:34 PM

Ryan is correct, I got a notification on the 22nd and then again today.

I'm re-closing this ticket as it works in 99% of the cases.
If preventing double-thanking on different days is really wanted, please create a separate enhancement request.

Florian reopened this task as Open.Mar 13 2015, 6:20 PM
Florian added subscribers: Moushira, Florian.

Reopen this and adding @Moushira (see screenshot). I think she doesn't logged out and in again to thank me twice? Maybe she can say, what happens to see, if it is a real bug or not :)

P.S.: Yes, it's the same revision, same article, same edit :)

EBernhardson removed EBernhardson as the assignee of this task.Apr 23 2015, 10:46 PM
EBernhardson set Security to None.
EBernhardson removed a subscriber: EBernhardson.