The cause of the bug lies in that isMockMove=true creates a temporal board in fenApply() which by default the promoteTo is set to Queen.
When using Ic.fenApply(fen, "playMove", [...]), it becomes clear that the temporal board will default to Queen unless a promoteTo option is passed. But when using board.playMove("...", {isMockMove : true}) it is expected that it will use the current board.promoteTo by default when a promoteTo option is not passed.
The severity of the bug is low as it doesn't impact anything for parsing or validation, and only gives unexpected behavior to anyone manually using it in this specific edge scenario.
Note to self: the solution could be give fenApply its own p options: Ic.fenApply(fen, "playMove", [..., p], p), the users calling playMove via fenApply will not need to change anything or pass any extra parameter, and the users calling playMove via board.playMove() would not need to change anything or pass any extra parameter. The change will be internally and the API would be unaffected, but the bug should be gone after this.
The cause of the bug lies in that
isMockMove=true
creates a temporal board in fenApply() which by default thepromoteTo
is set to Queen.When using
Ic.fenApply(fen, "playMove", [...])
, it becomes clear that the temporal board will default to Queen unless apromoteTo
option is passed. But when usingboard.playMove("...", {isMockMove : true})
it is expected that it will use the currentboard.promoteTo
by default when apromoteTo
option is not passed.The severity of the bug is low as it doesn't impact anything for parsing or validation, and only gives unexpected behavior to anyone manually using it in this specific edge scenario.