Opened 14 years ago

Closed 13 years ago

#67 closed defect (fixed)

[PATCH] process-quarantine.pl and expire-quarantine-cache.pl don't recalculate statistics

Reported by: paul@… Owned by: rjl
Priority: normal Milestone: 1.0.1
Component: Perl scripts Version: 1.0.0 RC5
Severity: normal Keywords: stats statistics process-quarantine.pl expire-quarantine-cache.pl
Cc:

Description

From Maia-dev archives

I just noticed that expiring the quarantine messages does not force the stats to be rebuilt. This does not cause a problem with an individual user's stats, since the stats are recalculated when the stats are viewed. But since the system stats are just the sum of all of the users stats that are currently in the database, this could state that there is more suspected ham and spam system wide than there actually is.

Attachments (1)

process-quarantine.pl.diff (7.8 KB) - added by paul@… 14 years ago.
Diff of process-quarantine that has a fix

Download all attachments as: .zip

Change History (7)

Changed 14 years ago by paul@…

Diff of process-quarantine that has a fix

comment:1 Changed 14 years ago by paul@…

The same patch should happen in expire-quarantine-cache.pl right after the call to expire_orphans

Since this function is the same as in process-quarantine.pl, should there be a file that contains shared functions?

comment:2 Changed 14 years ago by rjl

  • Resolution set to invalid
  • Status changed from new to closed

Actually, the domain-wide and system-wide stats are not the aggregate total of the user stats from the domain/system. They represent only the items that defaulted to the domain and system accounts.

Remember that domain-default and system-default users are actual Maia accounts, too, so when you go to view the stats for those accounts they update correctly just like any other Maia account.

This is an important behaviour to maintain--it's the way that administrators are able to manage the quarantines/caches for domain-default and system-default accounts. If those stats were to instead represent the aggregate of the users in those domains, there would need to be another way to identify the items that "defaulted".

I think you're looking for a different behaviour (i.e. a new feature) and simply misunderstanding how an existing feature is supposed to work. Better to open a new ticket as a feature request ("enhancement") and keep https://www.renaissoft.com/cgi-bin/trac.cgi/ticket/41 41 in mind.

comment:3 Changed 14 years ago by paul@…

  • Resolution invalid deleted
  • Status changed from closed to reopened

Actually I think that that script does the right thing. It goes through each of the users (including the @domain and the @ users), and recalculates the stats for just that user

This information is needed for the "View Systemwide Statistics" link at the bottom of every users stats screen, as well as the public.php stats.

Without this change, these stats will only be accurate if every user views their stats screen, since each users stats only get recaculated at that time. So if user x has 100 suspected spam, and then verifies all of them, and then does not visit their stats page, the suspected spame value in the "Systemwide Statistics" page will be 100 greater than it should be

Also, without this change, expiring suspected_* will cause the stats to be wrong.

comment:4 Changed 14 years ago by rjl

True. Yes, for the "View Systemwide Stats" (i.e. public.php) this is necessary. I was mistakenly thinking you were referring to stats.php for the "@." user, which is a different thing altogether. Confusion, in other words, over what was meant by "systemwide stats" :) Two different contexts, two different meanings.

comment:5 Changed 13 years ago by Ed <maia@…>

  • Summary changed from process-quarantine.pl and expire-quarantine-cache.pl don't recalculate statistics to [PATCH] process-quarantine.pl and expire-quarantine-cache.pl don't recalculate statistics

comment:6 Changed 13 years ago by rjl

  • Keywords stats statistics process-quarantine.pl expire-quarantine-cache.pl added
  • Milestone set to 1.0.1
  • Resolution set to fixed
  • Status changed from reopened to closed
  • Version set to 1.0.0 RC5

Fixed in Changeset 968, which performs the necessary recalculations in both process-quarantine.pl and expire-quarantine-cache.pl, if any items were deleted.

Note: See TracTickets for help on using tickets.