Skip to content

Race condition when starting multiple games at the same time #110

@Leonabcd123

Description

@Leonabcd123

The last game's final balance overrides the first game's resulting balance.

Steps to reproduce:

  1. Start banana-rps game
  2. Start banana-flip game
  3. Finish banana-rps game
  4. Notice final balance is the one at the end of banana-rps, and it does not consider the result from banana-flip. This means that if you run:
/banana-rps 100
/banana-flip heads 100

with starting balance being 100, and you win in banana-flip but lose in banana-rps, your final balance will be 0.

Expected Behavior

The user's balance should decrease when the game starts, so the example shown before would look like this:

// Balance: 100

/banana-rps 100

// Balance: 0

/banana-flip heads 100

// Error: You don't have enough bananas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions