alexa-games / skill-flow-builder

Development suite that helps you create narrative-driven Alexa skills, including a GUI editor and CLI
Other
69 stars 17 forks source link

Bug: Driver Extension param.userInputHelper.getHandlerInput() always undefined? #51

Closed pavja2 closed 3 years ago

pavja2 commented 3 years ago

Bug Report

I am unable to access the HandlerInput object when developing driver extensions and testing them in the SFB simulator.

Skill Flow Builder Version

2.1.0

ASK CLI Version

2.22.4

Current Behavior

When debugging a custom driver extension in the skill flow builder, the value of param.userInputerHelper.getHandlerInput() always comes back as undefined. I can't tell if this same behavior is happening for deployed skills, or only in the context of the simulator, so apologies if this is intended but undocumented behavior.

Expected Behavior

It should be possible to operate on the HandlerInput object when simulating and developing skills.

Steps to Reproduce

Create a custom driver extension:

import { DriverExtension, DriverExtensionParameter } from '@alexa-games/sfb-f';

export class HandlerInputExtension implements DriverExtension {

    async pre(param: DriverExtensionParameter){
        const handlerInput = param.userInputHelper.getHandlerInput()
        if (handlerInput) {
            console.log("Pre handler received");
        }
    }

    async post(param: DriverExtensionParameter){
        const handlerInput = param.userInputHelper.getHandlerInput();
        if(handlerInput){
                console.log("Post handler received");
        }
    }

}

Neither of the console.log() messages every show up in the skill flow builder developer console when testing the driver extension. This same behavior can be seen when debugging the Quiz skills driver extension example.

pavja2 commented 3 years ago

After looking into this further, I'm 99% sure it's intended behavior. While it'd be a nice feature to debug the whole node skill within the SFB editor, it makes sense that it's not implemented yet. Feel free to re-open the issue if I'm wrong though!