No username in modlog entries #3443

Closed
opened 2020-01-24 23:49:01 +01:00 by wxMichael · 7 comments
wxMichael commented 2020-01-24 23:49:01 +01:00 (Migrated from github.com)

Command bugs

Command name

hackban, reason

What cog is this command from?

Mod, ModLog

What were you expecting to happen?

ModLog entry should show a nickname and/or username.

What actually happened?

For users that aren't in the server, the ModLog entry shows no information indicating what user the entry is for.

How can we reproduce this issue?

Moderate or update a ModLog entry for any user not in the server or not in the bot's cache.

modlog

# Command bugs #### Command name hackban, reason #### What cog is this command from? Mod, ModLog #### What were you expecting to happen? ModLog entry should show a nickname and/or username. #### What actually happened? For users that aren't in the server, the ModLog entry shows no information indicating what user the entry is for. #### How can we reproduce this issue? Moderate or update a ModLog entry for any user not in the server or not in the bot's cache. ![modlog](https://user-images.githubusercontent.com/10516759/73109603-9d844600-3ed1-11ea-9f2a-33985f4bde61.png)
Stonedestroyer commented 2020-01-24 23:51:05 +01:00 (Migrated from github.com)

This is intended behavior. If the user isn't cached in the bot it will be unknown user. It was done to reduce the amount of fetch calls done to discord server to avoid 403s.

This is intended behavior. If the user isn't cached in the bot it will be unknown user. It was done to reduce the amount of fetch calls done to discord server to avoid 403s.
mikeshardmind commented 2020-01-24 23:55:50 +01:00 (Migrated from github.com)

Intentional, Modlog fetching user info was causing rate-limit issues. Fetching user info is an extremely limited operation compared to many others.

Intentional, Modlog fetching user info was causing *rate-limit* issues. Fetching user info is an extremely limited operation compared to many others.
wxMichael commented 2020-01-25 01:01:32 +01:00 (Migrated from github.com)

Could it not keep at least the user ID or username that is already in the modlog entry, instead of wiping it?

Could it not keep at least the user ID or username that is already in the modlog entry, instead of wiping it?
mikeshardmind commented 2020-01-25 06:17:30 +01:00 (Migrated from github.com)

image

This image uses the non-embedded form but the scenarios do not differ between the two here.

In the first one, the user was in the bot's cache, so we kept the name and ID.
In the second one, the user wasn't in the bot's cache. We don't have the name and don't fetch it, but we keep the ID.
In the third one, we had both the name and id, but we discard the name to avoid modlog being used by bots to advertise, keeping the ID.

In no circumstance do we not at least store the ID. We are guaranteed to always have this when the bot is performing a ban.

![image](https://user-images.githubusercontent.com/22035876/73116601-033ef500-3f07-11ea-885a-c02f6dc01102.png) This image uses the non-embedded form but the scenarios do not differ between the two here. In the first one, the user was in the bot's cache, so we kept the name and ID. In the second one, the user wasn't in the bot's cache. We don't have the name and don't fetch it, but we keep the ID. In the third one, we had both the name and id, but we discard the name to avoid modlog being used by bots to advertise, keeping the ID. In no circumstance do we not at least store the ID. We are guaranteed to always have this when the bot is performing a ban.
mikeshardmind commented 2020-01-25 20:56:41 +01:00 (Migrated from github.com)

My mistake. Misunderstood a piece of what was said when reading this before. The embedded form is differing in an unintended way and this is the issue, not the name not being present itself.

My mistake. Misunderstood a piece of what was said when reading this before. The embedded form is differing in an unintended way and this is the issue, not the name not being present itself.
Twentysix26 commented 2020-02-08 22:01:17 +01:00 (Migrated from github.com)

I'd like to reopen this issue as today I noticed a problem by following these steps:

  1. Ban user without providing a reason. Username shows up in the modlog as expected.
  2. Insert a [p]reason
  3. The message gets edited with the reason and the username gets discarded, now showing [Unknown or Deleted User] (ID)

This makes the modlog entry itself less useful for future moderation checks and throws away information that was already present, which IMO is not a behaviour that one would reasonably expect. I'd rather have outdated information rather than no information at all.

I'd like to reopen this issue as today I noticed a problem by following these steps: 1. Ban user without providing a reason. Username shows up in the modlog as expected. 2. Insert a `[p]reason` 3. The message gets edited with the reason and the username gets discarded, now showing `[Unknown or Deleted User] (ID)` This makes the modlog entry itself less useful for future moderation checks and throws away information that was already present, which IMO is not a behaviour that one would reasonably expect. I'd rather have outdated information rather than no information at all.
mikeshardmind commented 2020-02-09 05:16:37 +01:00 (Migrated from github.com)

Quick summary of discussion in Discord:

  1. We can't just fetch the members on edit again.
  2. We can accept some outdated info happening.
  3. We shouldnt try to parse a modlog message

Which means we need modlog to store what was name#discrim that was available at the original action, if any and change how some of the updating happens.

Quick summary of discussion in Discord: 1. We can't just fetch the members on edit again. 2. We can accept some outdated info happening. 3. We shouldnt try to parse a modlog message Which means we need modlog to store what was name#discrim that was available at the original action, if any and change how some of the updating happens.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#3443
No description provided.