Skip to content

Comments

fix(GameView): prevent double API call in playOneOff during seven resolution#1335

Merged
itsalaidbacklife merged 2 commits intomainfrom
fix/play-one-off-double-fire
Feb 12, 2026
Merged

fix(GameView): prevent double API call in playOneOff during seven resolution#1335
itsalaidbacklife merged 2 commits intomainfrom
fix/play-one-off-double-fire

Conversation

@seriouslysean
Copy link
Collaborator

@seriouslysean seriouslysean commented Feb 10, 2026

Found during a code audit. playOneOff() has two sequential if blocks instead of if/else. When resolving a seven, if both cardSelectedFromDeck and selectedCard are set, both requestPlayOneOffSeven() AND requestPlayOneOff() fire. Two API calls for one user action.

Added an early return after the seven-resolution path so it never falls through to the normal one-off path.

Issue number

  • N/A (found during code audit)

Please check the following

  • Do the tests still pass?
  • Is the code formatted properly?

Please describe additional details for testing this change

  1. npm run test:unit
  2. Play a game where you resolve a seven by playing a one-off — should work exactly the same, but now only fires one API call instead of potentially two

@seriouslysean seriouslysean added the bug Something isn't working label Feb 10, 2026
Copilot AI review requested due to automatic review settings February 10, 2026 03:27
@seriouslysean seriouslysean added the version-patch An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1) label Feb 10, 2026
@seriouslysean seriouslysean self-assigned this Feb 10, 2026
@seriouslysean seriouslysean added bug Something isn't working version-patch An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1) labels Feb 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a gameplay bug in GameView.vue where playOneOff() could trigger two API calls during seven resolution due to falling through from the seven-resolution path into the normal one-off path.

Changes:

  • Add an early return after requestPlayOneOffSeven() to prevent fall-through into requestPlayOneOff() when resolving a seven.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@itsalaidbacklife itsalaidbacklife added the frontend Requires changes to the frontend (vue) client label Feb 12, 2026
@itsalaidbacklife itsalaidbacklife merged commit f47b2e5 into main Feb 12, 2026
9 checks passed
@itsalaidbacklife itsalaidbacklife deleted the fix/play-one-off-double-fire branch February 12, 2026 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend Requires changes to the frontend (vue) client version-patch An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants