-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add error logging when removing empty voice commands and voice command strings #1799
Conversation
Codecov Report
@@ Coverage Diff @@
## 5.4.0_RC #1799 +/- ##
===========================================
Coverage ? 54.06%
Complexity ? 5522
===========================================
Files ? 562
Lines ? 25718
Branches ? 3370
===========================================
Hits ? 13905
Misses ? 10556
Partials ? 1257 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few suggestions
continue; | ||
} | ||
String trimmedString = voiceCommandString.trim(); | ||
if (trimmedString.length() > 0) { | ||
voiceCommandStrings.add(trimmedString); | ||
} else { | ||
DebugTool.logWarning(TAG, "Empty voice command string removed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebugTool.logWarning(TAG, "Empty voice command string removed"); | |
DebugTool.logWarning(TAG, "Empty string removed from voice command"); |
} | ||
} | ||
if (voiceCommandStrings.size() > 0) { | ||
voiceCommand.setVoiceCommands(voiceCommandStrings); | ||
validatedVoiceCommands.add(voiceCommand); | ||
} else { | ||
DebugTool.logWarning(TAG, "Empty voice command removed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebugTool.logWarning(TAG, "Empty voice command removed"); | |
DebugTool.logWarning(TAG, "Voice command will not be uploaded as it contained no valid strings"); |
@@ -217,21 +217,27 @@ private void updateIdsOnVoiceCommands(List<VoiceCommand> voiceCommands) { | |||
List<VoiceCommand> validatedVoiceCommands = new ArrayList<>(); | |||
for (VoiceCommand voiceCommand : voiceCommands) { | |||
if (voiceCommand == null) { | |||
DebugTool.logWarning(TAG, "Null voice command removed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebugTool.logWarning(TAG, "Null voice command removed"); | |
DebugTool.logWarning(TAG, "Voice command is null, it will not be uploaded"); |
continue; | ||
} | ||
List<String> voiceCommandStrings = new ArrayList<>(); | ||
for (String voiceCommandString : voiceCommand.getVoiceCommands()) { | ||
if (voiceCommandString == null) { | ||
DebugTool.logWarning(TAG, "Null voice command string removed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DebugTool.logWarning(TAG, "Null voice command string removed"); | |
DebugTool.logWarning(TAG, "Removing null string from Voice Command"); |
Fixes #1798
This PR is ready for review.
Risk
This PR makes no API changes.
Testing Plan
Unit Tests
N/A - This PR only adds logging
Core Tests
VoiceCommand
containing no command stringsVoiceCommand
to an HMI usingVoiceCommandManager
Expected Results: The
VoiceCommand
fails to send and a warning is loggedObserved Results: The
VoiceCommand
fails to send and a warning is loggedSummary
Adds more logging to
BaseVoiceCommandManager.removeEmptyVoiceCommands()
Changelog
Breaking Changes
Enhancements
Bug Fixes
CLA