[Bug]: Closing multiple abuse reports during a review rejection resulted in multiple rejections being sent
What happened?
When processing an add-on review with a rejection action and closing abuse reports sending out the review verdict, if multiple abuse reports are sent, then the version log shows multiple entries for the same review action (rejection, in this case)
Example AMO ID: 2756955
What did you expect to happen?
Irrespective of how many abuse reports are closed, one reviewer action should only result in one reviewer action log in the add-on's version review history.
Is there an existing issue for this?
- [x] I have searched the existing issues
┆Issue is synchronized with this Jira Task
@abhn: a single job with multiple abuse reports, or multiple jobs (with one or more abuse reports each)?
Hmm, I don't know which one exactly right now.
Can there be multiple jobs with one or more abuse reports each attached to a single version? @eviljeff
Hmm, I don't know which one exactly right now.
Can there be multiple jobs with one or more abuse reports each attached to a single version? @eviljeff
If they come in directly as abuse reports, no, Cinder will combine them. If they're forwarded by TaskUs moderators, yes.
If they're separate jobs they will have separate checkboxes to select to resolve; if they're multiple reports in a single job, it'll be a single checkbox
So if I want to resolve multiple jobs (by selecting multiple checkboxes) when resolving them by submitting a review verdict, multiple reviews would get sent to the developer (with multiple log of the same review verdict in reviewer tools version review log)?
So if I want to resolve multiple jobs (by selecting multiple checkboxes) when resolving them by submitting a review verdict, multiple reviews would get sent to the developer (with multiple log of the same review verdict in reviewer tools version review log)?
Yes to the review log - maybe to the developer, I'd have to double check - but they are processed individually, yes.
@abhn: a single job with multiple abuse reports, or multiple jobs (with one or more abuse reports each)?
I didn't see an explicit answer on this - do you remember?
I didn't see an explicit answer on this - do you remember?
I don't, as I didn't process that review nor is that information exposed in reviewer tools.
Yes to the review log - maybe to the developer
Okay understood. It is suboptimal to have multiple review entries for what was a single action from the reviewer's PoV.
Given that we do not record what was closed during a review submission, and just log the reviewer's verdict, it makes it even less comprehensible what happened.
Should it log multiple times if a single action closed the multiple reports?
It was multiple check boxes, each checkbox with several abuse reports attached to it, so definitely multiple jobs.
@abhn for clarification could you attach a screenshot of this (in jira)
Need to investigate, are there multiple jobs ? I assume yes because of forwarded jobs ? Are there multiple decisions created then ? If so, I assume we don't want to link a single activity to multiple decisions, can we have a single decision closing multiple jobs ?
Are there multiple decisions created then ? If so, I assume we don't want to link a single activity to multiple decisions, can we have a single decision closing multiple jobs ?
In Cinder it's a single decision per job, so each job is resolved separately. So we need to create a ContentDecision for each CinderJob.
It is possible to have multiple ContentDecision instances associated with a single activity log on a technical level, and what emails we send is our choice - whether we add the extra complexity to create a single ActivityLog instance, and send out a single email to the developer (both in implementation time, and maintainability) is another question though.
To investigate: can we do what we are doing now but somehow avoid duplicating emails to the owner(s) (still need to send emails to each reporter if necessary) and activities ?
How to deal with appeals is another question though, as they are tied to each decision
To investigate: can we do what we are doing now but somehow avoid duplicating emails to the owner(s) (still need to send emails to each reporter if necessary) and activities ?
Given that we currently have to use the activity log to try and measure performance, the impact is more than just duplicated emails.
Yes, I know, my sentence had a "and activities" at the end to account for that.
I think the path forward is:
- In the
process_action()method for the variousContentActionclasses, don't record a newActivityLogif we didn't do anything (i.e. the action has already been carried out), and returnNoneinstead of the activity. That's already how it's implemented for many of them, includingContentActionDisableAddonwhich is used for Force Disable, but not forContentActionRejectVersion/ContentActionRejectVersionDelayed. It's a little messier to figure out that we didn't do anything for those actions but it's doable. - In
reviewers/utils.pyrecord_decision(), handle the fact thatlog_entrycould beNoneafter callingexecute_action(), and pass something toreport_decision_to_cinder_and_notify()task indicating whether or not that decision had alog_entry. - In
abuse/tasks.pyreport_decision_to_cinder_and_notify()task, pass down that information tosend_notifications() - In
abuse/models.pysend_notifications(), if we didn't record a log entry, don't callnotify_owners(), only notify reporters.
We would still record as many decisions as there are jobs to resolve, but only one would create a single ActivityLog and send a single email to owners. As mentioned above, that's already how it's implemented for Force Disable [^1].
A small implementation question to solve with this approach: would we want to attach the lone ActivityLog to each decision ? If so, we'd need to be careful do still not notify owners only once.
[^1]: Although fun fact, at the moment, if you force disable resolving 2 different jobs, we will raise a 500 error, because we attempt to create a ReviewActionReasonLog with activity_log=log_entry for all decisions, including those that result in log_entry being None.
We probably still want to associate all the ContentDecision instances with the activity log though - I guess we can just manually create ContentDecisionLog instances to link them?
Yes, that was my question at the end. We could edit the activity details and relink any missing ContentDecision once they have all been created.
STR:
- Report an add-on for policy violation on the website (leave your email as the reporter)
- In Cinder, escalate that to reviewers
- Report an add-on for policy violation on the website again (leave a different email as the reporter)
- In Cinder, escalate that to reviewers again
- In the review page, that add-on should now have 2 jobs to resolve when selecting an action
- Disable the add-on while checking the checkboxes to resolve those 2 jobs
- The developer should get a single email, each reporter should get one too. A single activity log should have been recorded and made visible in the review page
Repeat with a different add-on, this time rejecting multiple versions instead of disabling the add-on.
I tried this on dev and stage.
On dev I no longer see the email sent to the developer multiple times. Each reporter will get an email. In case a reporter has been reporting the add-on multiple times then it will get multiple emails about the content being disabled.
The review pages display the activity once scenario with reject from rev tools https://reviewers.addons-dev.allizom.org/en-US/reviewers/review-listed/637874 scenario with disable from rev tools https://reviewers.addons-dev.allizom.org/en-US/reviewers/review-listed/637848
On stage I could reproduce the scenario with reject -> multiple emails sent to developer + the activity displayed multiple times https://reviewers.addons.allizom.org/en-US/reviewers/review-listed/2248196
Also on -stage when disabling the add-on with this scenario I got a sever error but then checking things I see the addons disabled. This server error is not reproducible on dev.
I tried with https://reviewers.addons.allizom.org/en-US/reviewers/review/2248197
What I didn't see on -dev is reject and disable actions registered in reviewactionreasonlog admin. That's available now on -stage so it appears to be a regression.
I checked for activity logs in admin for this addon which has been rejected. Or this addon which has been disabled.
What I didn't see on -dev is reject and disable actions registered in reviewactionreasonlog admin. That's available now on -stage so it appears to be a regression.
Is that because of https://github.com/mozilla/addons/issues/15513 ? The policy should be attached still.
Could be caused by it , last review action reason on dev is from May 21.
Filed it https://github.com/mozilla/addons/issues/15622