Skip to content

Add menu restriction option and fix concurrency race condition in ConfigCommand #53

@coderabbitai

Description

@coderabbitai

Description

While reviewing PR #41, a potential concurrency race condition was identified in the ConfigCommand.java file. When multiple users interact with the same menu (confirming or canceling a configuration change), the config could be updated or overwritten unpredictably.

Feature Request

Add an option for menus to be only usable by the person who triggered them. This would solve two problems:

  1. Prevent unauthorized users from interacting with menus not intended for them
  2. Prevent race conditions when multiple users interact with the same menu simultaneously

Context

Implementation Suggestions

  • Add a 'restrictToOriginalUser' boolean option to menu creation methods
  • When enabled, check if the interacting user matches the user who triggered the original command
  • Reject interactions from other users with an appropriate message

Related Components

  • ConfigCommand.java
  • MenuManager implementation
  • SelectMenu class

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions