Skip to content

Fix Multiple Pairs bug#23

Open
geoff-jiang wants to merge 1 commit intomainfrom
geoff/fix-double-pairs
Open

Fix Multiple Pairs bug#23
geoff-jiang wants to merge 1 commit intomainfrom
geoff/fix-double-pairs

Conversation

@geoff-jiang
Copy link
Contributor

Problem:

Last cycle, some people ended up with more than one pairing.

Cause:

The interval was set to 0.2 minutes, meaning that Dinubot ran every 12 seconds. When it was time to create new pairings, Dinubot would begin pairing, then start another cycle before the first call was finished leading to corrupted data and multiple pairings.

This wasn't an issue previously because often the pairing would finish under 12 seconds and the next cycle would be skipped. But, because of the new lastPairings functionality, the algorithm took longer to find valid pairings and started a new cycle before the first finished.

Fix:

  • Refactored async calls to use await to ensure database calls complete before proceeding.
  • Implement a 'lock' (sent status) which is set to true immediately when a pairing cycle starts. Dinubot will now check the pairing status before starting a new cycle.
  • Also, increment the interval to 30 minutes instead of 12 seconds
    • I think either one of these fixes would work individually, including both anyways.

Additional notes:

Removed initial + test calls at the bottom

@geoff-jiang geoff-jiang self-assigned this Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant