This was caused because the case for BoostMessage.PORT_FEEDBACK didn't handle the BoostPortFeedback.DISCARDED type, which corresponds to a command failing on the Boost hub.
This commit is contained in:
Kevin Andersen 2019-04-05 13:35:28 -04:00
parent f02433510a
commit 2ee8042b6a

View file

@ -943,8 +943,9 @@ class Boost {
const motor = this.motor(portID);
if (motor) {
motor._status = feedback;
if (feedback === (BoostPortFeedback.COMPLETED ^ BoostPortFeedback.IDLE) &&
motor.pendingPromiseFunction) {
// Makes sure that commands resolve both when they actually complete and when they fail
const commandCompleted = feedback & (BoostPortFeedback.COMPLETED ^ BoostPortFeedback.DISCARDED);
if (commandCompleted && motor.pendingPromiseFunction) {
motor.pendingPromiseFunction();
}
}