Skip to content

Multiple off-by-one errors and silent reminder deletion with no user notification in reminders.py #3507

Description

@oliveman-au

The reminder limit for regular users is defined as:

MAXIMUM_REMINDERS = 5

However, the check in new_reminder uses a strict greater-than comparison:

if len(active_reminders) > MAXIMUM_REMINDERS:
    await send_denial(ctx, "You have too many active reminders!")
    return

Because > 5 only triggers when a user already has 6 reminders, a user can successfully create a 6th reminder before being blocked.

The fix would be changing > to >=.

Steps to reproduce (as a regular member in #bot-commands):

  1. Run !remind new 7d reminder 1 through !remind new 7d reminder 6 six times
  2. All six succeed — the denial is never triggered

Expected: denial on the 6th attempt
Reproduced on: bot/exts/utils/reminders.py, line 478

Proof shown below in images or can be recreated with steps above

Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: approvedThe issue has received a core developer's approval

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions