[Cleanup] bot reports incorrect number of messages it mass deleted #4155

Closed
opened 2020-08-04 11:35:35 +02:00 by owocado · 2 comments
owocado commented 2020-08-04 11:35:35 +02:00 (Migrated from github.com)

Command bugs

Command name

[p]cleanup messages [>100]

What cog is this command from?

Cleanup

What were you expecting to happen?

Bot should report the exact or correct amount of messages it deleted from the given channel in console/logs.

What actually happened?

Bot reports incorrect amount of messages deleted in console. I think it passes the same number we give as input.

How can we reproduce this issue?

Load cleanup cog, if haven't.
Try to delete more than 100 messages in a given channel with [p]cleanup messages. Confirm when prompted to.
Try to pass an integer larger than the total number of messages of last 2 weeks which exists in the target channel. <- This step is essential to reproduce this bug.
Observe in your console/logs the amount the bot returns as deleted messages.
image
(^^for context in this screenshot, I used [p]cleanup messages 500 in a channel.)

Now check your guild audit logs and see how many messages the bot actually deleted and cross-verify with the output bot provided in console/logs.
image
You should be able to confirm that bot reports incorrect number of messages it mass deleted.


While I have only observed and tested this with [p]cleanup messages subcommand, I assume the same bug should occur with other cleanup subcommands becuase of how check_100_plus() staticmethod is handled, though I could be wrong, but please verify it with other cleanup subcommands.

# Command bugs <!-- Did you find a bug with a command? Fill out the following: --> #### Command name [p]cleanup messages [>100] #### What cog is this command from? Cleanup #### What were you expecting to happen? Bot should report the exact or correct amount of messages it deleted from the given channel in console/logs. #### What actually happened? Bot reports incorrect amount of messages deleted in console. I think it passes the same number we give as input. #### How can we reproduce this issue? Load cleanup cog, if haven't. Try to delete more than 100 messages in a given channel with `[p]cleanup messages`. Confirm when prompted to. Try to pass an integer larger than the total number of messages of last 2 weeks which exists in the target channel. <- This step is essential to reproduce this bug. Observe in your console/logs the amount the bot returns as deleted messages. ![image](https://user-images.githubusercontent.com/24418520/89275927-94ceb280-d660-11ea-9bc9-2f6441c2a9c8.png) (^^for context in this screenshot, I used `[p]cleanup messages 500` in a channel.) Now check your guild audit logs and see how many messages the bot actually deleted and cross-verify with the output bot provided in console/logs. ![image](https://user-images.githubusercontent.com/24418520/89275865-7b2d6b00-d660-11ea-8933-29ecbd9d930d.png) You should be able to confirm that bot reports incorrect number of messages it mass deleted. ----- While I have only observed and tested this with `[p]cleanup messages` subcommand, I assume the same bug should occur with other cleanup subcommands becuase of how `check_100_plus()` staticmethod is handled, though I could be wrong, but please verify it with other `cleanup` subcommands.
Vexed01 commented 2020-08-04 12:11:45 +02:00 (Migrated from github.com)

I can verify it is inaccurate with [p]cleanup messages.

cleanup after - working
cleanup before - working
cleanup between- working
cleanup bot - working (there is an unnecessary space after the number in the logs though)
cleanup messages - as you established, not working
cleanup self - working
cleanup spam - working
cleanup text - working
cleanup user - working

TLDR: Just cleanup messages

Sigh, too late it's already got a PR. Poor Vexed's testing server now having a destroyed message history...

I can verify it _is_ inaccurate with `[p]cleanup messages`. `cleanup after` - working `cleanup before` - working `cleanup between`- working `cleanup bot` - working (there is an unnecessary space after the number in the logs though) `cleanup messages` - as you established, **not working** `cleanup self` - working `cleanup spam` - working `cleanup text` - working `cleanup user` - working TLDR: Just cleanup messages _Sigh_, too late it's already got a PR. Poor Vexed's testing server now having a destroyed message history...
MeatyChunks commented 2020-08-04 12:13:49 +02:00 (Migrated from github.com)

I destroyed mine in the process too, don't worry! :D

I destroyed mine in the process too, don't worry! :D
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#4155
No description provided.