Skip to content

VoiceCommandManager should not send commands with duplicate strings. #413

@renonick87

Description

@renonick87

Bug Report

The VoiceCommandManager is not filtering out VoiceCommands with duplicate strings when sending AddCommands.

Reproduction Steps
  1. Send a voice command array (3 voice commands, each with 2 strings). One voice command should have both strings as the same. e.g. ("Command 1", "Command 1"), ("Command 2", "Command 3"), ("Command 4", "Command 5")
Expected Behavior

Only the VoiceCommands without duplicate strings should be sent, and an error should be logged.

Observed Behavior

All VoiceCommands are sent and duplicate commands appear in the HMI.

Test Case, Sample Code, and / or Example App

In this sample code, the first VoiceCommand should not be sent.

screenManager.setVoiceCommands([
    new SDL.manager.screen.utils.VoiceCommand(['Option 1', 'Option 1'], () => {}),
    new SDL.manager.screen.utils.VoiceCommand(['Option 2', 'Option 3'], () => {}),
    new SDL.manager.screen.utils.VoiceCommand(['Option 4', 'Option 5'], () => {}),
]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions