Last modified: 2014-02-09 04:23:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49143, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47143 - Edit revert should not trigger a talk page post notification if the edit being reverted was performed by the owner of the talk page
Edit revert should not trigger a talk page post notification if the edit bein...
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
Echo (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Erik Bernhardson
:
: 47155 (view as bug list)
Depends on:
Blocks: 43833
  Show dependency treegraph
 
Reported: 2013-04-11 23:31 UTC by Ryan Kaldari
Modified: 2014-02-09 04:23 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Ryan Kaldari 2013-04-11 23:31:07 UTC
If you perform a rollback on an edit performed by the owner of the talk page, it sends 2 notifications to the owner. It should only send one - probably the rollback notification.
Comment 1 Ryan Kaldari 2013-04-18 23:39:35 UTC
*** Bug 47155 has been marked as a duplicate of this bug. ***
Comment 2 Ryan Kaldari 2013-04-18 23:40:47 UTC
This is actually a bit tricky to fix correctly.
Comment 3 Erik Bernhardson 2013-05-01 18:14:10 UTC
Looked over this, basically the end goal is to not send more than one notification to a user regarding a specific change.  Both of these changes come from the same hook which calls EchoHooks::onArticleSaved.  

I'm thinking we can create an empty array, $notified that will contain a list of user ids that have already been notified regarding this change.  First we do the revert event, if that fires we add the victim's user id to $notified.  Next DiscussionParser::generateEventForRevision can run, which will be passed the list of notified users.  This can then check before sending the notification about an updated talk page we can do !in_array( $user->getID(), $previouslyNotified ).

A quick test implementing this seems to work, but I may be missing several edge cases that I just dont know about yet.  I cant push a fix to gerrit yet though as my ssh keys are not yet valid.
Comment 4 bsitu 2013-05-01 18:36:40 UTC
(In reply to comment #3)
> Looked over this, basically the end goal is to not send more than one
> notification to a user regarding a specific change.  Both of these changes
> come
> from the same hook which calls EchoHooks::onArticleSaved.  
> 
> I'm thinking we can create an empty array, $notified that will contain a list
> of user ids that have already been notified regarding this change.  First we
> do
> the revert event, if that fires we add the victim's user id to $notified. 
> Next
> DiscussionParser::generateEventForRevision can run, which will be passed the
> list of notified users.  This can then check before sending the notification
> about an updated talk page we can do !in_array( $user->getID(),
> $previouslyNotified ).
> 
> A quick test implementing this seems to work, but I may be missing several
> edge
> cases that I just dont know about yet.  I cant push a fix to gerrit yet
> though
> as my ssh keys are not yet valid.

This may not work when we enable job queue to process notifications.  We can't pass $notifiedUser from one job to another
Comment 5 Erik Bernhardson 2013-05-01 18:48:57 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > Looked over this, basically the end goal is to not send more than one
> > notification to a user regarding a specific change.  Both of these changes
> > come
> > from the same hook which calls EchoHooks::onArticleSaved.  
> > 
> > I'm thinking we can create an empty array, $notified that will contain a list
> > of user ids that have already been notified regarding this change.  First we
> > do
> > the revert event, if that fires we add the victim's user id to $notified. 
> > Next
> > DiscussionParser::generateEventForRevision can run, which will be passed the
> > list of notified users.  This can then check before sending the notification
> > about an updated talk page we can do !in_array( $user->getID(),
> > $previouslyNotified ).
> > 
> > A quick test implementing this seems to work, but I may be missing several
> > edge
> > cases that I just dont know about yet.  I cant push a fix to gerrit yet
> > though
> > as my ssh keys are not yet valid.
> 
> This may not work when we enable job queue to process notifications.  We
> can't
> pass $notifiedUser from one job to another


I will look over the job queueing code to get an idea of whats going on there, at which point in execution does it move into job queue?  I was thinking i

In this case EchoHooks::onArticleSaved directly calls EchoDiscussionParser::generateEventsForRevision as opposed to going through any kind of indirection, so while not in the general case, in this particular case i think we can pass it through.
Comment 6 Gerrit Notification Bot 2013-05-01 21:48:54 UTC
Related URL: https://gerrit.wikimedia.org/r/61902 (Gerrit Change Ic2d990057d88c27e6ed25c8d2d4adb995d196f65)
Comment 7 bsitu 2013-05-01 22:13:07 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Looked over this, basically the end goal is to not send more than one
> > > notification to a user regarding a specific change.  Both of these changes
> > > come
> > > from the same hook which calls EchoHooks::onArticleSaved.  
> > > 
> > > I'm thinking we can create an empty array, $notified that will contain a list
> > > of user ids that have already been notified regarding this change.  First we
> > > do
> > > the revert event, if that fires we add the victim's user id to $notified. 
> > > Next
> > > DiscussionParser::generateEventForRevision can run, which will be passed the
> > > list of notified users.  This can then check before sending the notification
> > > about an updated talk page we can do !in_array( $user->getID(),
> > > $previouslyNotified ).
> > > 
> > > A quick test implementing this seems to work, but I may be missing several
> > > edge
> > > cases that I just dont know about yet.  I cant push a fix to gerrit yet
> > > though
> > > as my ssh keys are not yet valid.
> > 
> > This may not work when we enable job queue to process notifications.  We
> > can't
> > pass $notifiedUser from one job to another
> 
> 
> I will look over the job queueing code to get an idea of whats going on
> there,
> at which point in execution does it move into job queue?  I was thinking i
> 
> In this case EchoHooks::onArticleSaved directly calls
> EchoDiscussionParser::generateEventsForRevision as opposed to going through
> any
> kind of indirection, so while not in the general case, in this particular
> case
> i think we can pass it through.

Yes, you are right. The target users are known before creating the event for both of them, it works in this case
Comment 8 spage 2013-09-23 20:41:35 UTC
Prioritization and scheduling of this bug is tracked on Mingle card https://mingle.corp.wikimedia.org/projects/flow/cards/203

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links