-
Notifications
You must be signed in to change notification settings - Fork 131
Add error logging when removing empty voice commands and voice command strings #1799
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
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
| 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"); |
| 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"); |
| 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"); |
| 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
VoiceCommandcontaining no command stringsVoiceCommandto an HMI usingVoiceCommandManagerExpected Results: The
VoiceCommandfails to send and a warning is loggedObserved Results: The
VoiceCommandfails to send and a warning is loggedSummary
Adds more logging to
BaseVoiceCommandManager.removeEmptyVoiceCommands()Changelog
Breaking Changes
Enhancements
Bug Fixes
CLA