addons icon indicating copy to clipboard operation
addons copied to clipboard

Restriction activitylog/history are logged twice (4 times if you're trying to submit agreement again)

Open ioanarusiczki opened this issue 3 years ago • 5 comments
trafficstars

STR:

  • at logins, there's 2 entries in the activity log, it looks like it's been doubled
  • with domain restrictions , email user restrictions or ip network user restrictions when the restriction type is Submission, I think the Activity log registers 3 reports that seem to be the same thing -> when the user attempts to submit an addon

Notes: This is reproducible on -dev and -stage I've noticed 4 reports with the same content today while testing on -stage, with email address restricted at submissions.

┆Issue is synchronized with this Jira Task

ioanarusiczki avatar Aug 31 '22 09:08 ioanarusiczki

with domain restrictions , email user restrictions or ip network user restrictions when the restriction type is Submission, I think the Activity log registers 3 reports that seem to be the same thing -> when the user attempts to submit an addon

Do you mean that you get 3 activity logs even if there is a single restriction that would match for this submission ? If all 3 restrictions would apply, getting 3 individual logs is expected - though we could be smarter and group them, they are separate instances.

diox avatar Aug 31 '22 10:08 diox

@diox

For example I used DisposableEmailDomainRestriction for submissions on AMO stage (no other restriction), I restricted gmail.com -> then I tried with a gmail account to submit an addon -> I get "The email address used for your account is not allowed for add-on submission." -> I refresh the Activity Log, and there's 4 identical activity logs generated at the same hour.

restrictions

The /users/userrestrictionhistory/ model looks the same.

restriction

ioanarusiczki avatar Sep 01 '22 13:09 ioanarusiczki

The duplicate activity log on login is caused by the fact that we send the user_logged_in signal at login, but so does django. I'll investigate why we do that and remove the duplicate call.

Regarding the restriction... I can see why we're doubling: we trigger that code when the user is going through any step of the submission process, and we're redirecting to the agreement page if a restriction is hit, which is itself one of the steps, so that triggers it again. If you try going through that agreement as well, you would get 4...

diox avatar Sep 05 '22 11:09 diox

I created a different bug for the login twice issue (https://github.com/mozilla/addons/issues/8859), this one will be only about the restriction history/restricted activity log being logged multiple times.

diox avatar Sep 05 '22 12:09 diox

Old Jira Ticket: https://mozilla-hub.atlassian.net/browse/ADDSRV-117

KevinMind avatar May 03 '24 17:05 KevinMind

This issue has been automatically marked as stale because it has not had recent activity. If you think this bug should stay open, please comment on the issue with further details. Thank you for your contributions.

github-actions[bot] avatar Sep 29 '24 01:09 github-actions[bot]

unstale

wagnerand avatar Sep 30 '24 08:09 wagnerand