Logging checked_for_custom_avatar

I just exported all my logs, and found something interesting.

checked_for_custom_avatar accounted for 42,525 lines,

check_email accounted for 364 (maybe that gets purged?)

the other 880 items were all quite varied.

I wonder if we could skip logging checked_for_custom_avatar ?

4 Likes

Whew! sounds like it could use it’s own log file.

Yes, this seems absurd, can we remove logging this @zogstrip?

1 Like

I checked into this, and this is a per-user history entry that verifies we looked up their avatar.

context "a user who has been checked for a custom avatar" do
      before do
        UserHistory.create!(action: UserHistory.actions[:checked_for_custom_avatar], target_user_id: user.id )
      end

    # Finally, we don't check users whose avatars haven't been examined
    return unless UserHistory.exists_for_user?(@user, :checked_for_custom_avatar)

Which logs are you referring to? How are you exporting the per-user history logs? These are not under admin/logs AFAIK.

Also do you have 45,525 users? There should only be one of these records per user.

I was at [our forum]/admin/logs/staff_action_logs

I clicked the Export, and a while later received a notice that the export was ready.

We have about 500 users total.

I just did it again, same 2.4mb file, some 43785 lines.

I see that they mostly stopped in June of 2014… so maybe this was an old bug?

I wonder if there’s a reasonable way to purge all those?

Let me export our staff logs and get back to you.

edit: confirmed, we have a zillion of these rows as well in Staff Action Logs. That stopped about 5-27-2014. Looks like some kind of bug in the export process and/or an issue with the number of those records in the individual user histories. @techapj is having a look.

Fixed:

https://github.com/discourse/discourse/pull/3074

1 Like

That’s because that entry is not used anymore and has been removed in

I pushed a database migration to remove these useless user history entries

3 Likes