fix(Hand): treat _inactive: 2 (new player) as not playable#1
Open
OnChainMee wants to merge 2 commits intoyuga-labs:mainfrom
Open
fix(Hand): treat _inactive: 2 (new player) as not playable#1OnChainMee wants to merge 2 commits intoyuga-labs:mainfrom
OnChainMee wants to merge 2 commits intoyuga-labs:mainfrom
Conversation
- Hand.isPlayable() was incorrectly treating _inactive[i] === 2 as active - Per HAND.md and APPENDIX_SEATING.md, _inactive: 2 = new player (inactive until next hand) - Only _inactive === 0 or undefined now count as playable; 1 and 2 are not - Fixes failing test: should treat new players (_inactive: 2) as not playable - Add CONTRIBUTION_FINDINGS.md with audit of issues, bugs, and improvements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes
Hand.isPlayable()incorrectly treating_inactive[i] === 2(new player) as playable.Per HAND.md and APPENDIX_SEATING.md,
_inactive: 2means "new player" and they are inactive until next hand. Only_inactive === 0orundefinedshould count as playable.Changes
Hand.isPlayable(), only treat_inactive[i] === 0orundefinedas active;1(waiting/sitting out) and2(new player) are not playable.Test
Hand Data Extraction > Hand.isPlayable > should treat new players (_inactive: 2) as not playablenpx vitest run src/__tests__/api/hand/data-extraction.test.tspasses (45 tests)