From 2ee8042b6a404a17d82d065798fd9d69a0da8bf7 Mon Sep 17 00:00:00 2001 From: Kevin Andersen Date: Fri, 5 Apr 2019 13:35:28 -0400 Subject: [PATCH] Resolves #2085 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. --- src/extensions/scratch3_boost/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/extensions/scratch3_boost/index.js b/src/extensions/scratch3_boost/index.js index ccd7f6d5f..51396482e 100644 --- a/src/extensions/scratch3_boost/index.js +++ b/src/extensions/scratch3_boost/index.js @@ -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(); } }