Alexa skill not receiving UsagesRemoved request when widget is removed from the Widget Panel

87 views Asked by At

I have an Alexa skill written in Java. I am beta testing a version of the skill that contains a widget. I have handlers registered for the following requests:

  • UsagesInstalled

  • UsagesRemoved

  • UpdateRequest

  • InstallationError

My skill successfully receives and handles the UsagesInstalled request. However, when I remove the widget from the Widget Panel, my skill never receives the UsagesRemoved request.

I know my handler is properly registered because I am getting log messages from the canHandle(HandlerInput) method of the class for other requests.

Anytime a request is sent to my skill I see a message in the CloudWatch logs that starts with, “START RequestId:…”.

When I remove the widget from the Widget Panel, my skill does not receive any requests. At least, nothing is getting logged in CloudWatch.

I have the following in the manifest for my widget:

    "installStateChanges": "INFORM",
    "updateStateChanges": "INFORM",

I see the same behavior on both an Echo Show 10 and an Echo Show 15.

Any ideas?

Widget APL:

{
    "type": "APL",
    "version": "2023.2",
    "extensions": [
        {
            "name": "DataStore",
            "uri": "alexaext:datastore:10"
        }
    ],
    "settings": {
        "DataStore": {
            "dataBindings": [
                {
                    "namespace": "TeamAssist",
                    "key": "nextevent",
                    "dataBindingName": "DS_NextEvent",
                    "dataType": "OBJECT"
                }
            ]
        }
    },
    "import": [
        {
            "name": "alexa-layouts",
            "version": "1.7.0"
        }
    ],
    "mainTemplate": {
        "parameters": [
            "payload"
        ],
        "items": [
            {
                "type": "Container",
                "height": "100%",
                "items": [
                    {
                        "type": "AlexaBackground",
                        "colorOverlay": "true",
                        "backgroundImageSource": "${DS_NextEvent ? DS_NextEvent.backgroundImageURL : payload.nextEventDataSource.backgroundImageSource}"
                    },
                    {
                        "type": "AlexaFooterActionButton",
                        "id": "nextEventWidgetLaunch",
                        "buttonText": "${payload.nextEventDataSource.headerButtonText}",
                        "primaryAction": [
                            {
                                "type": "SendEvent",
                                "arguments": [
                                    "openSkill"
                                ],
                                "flags": {
                                    "interactionMode": "STANDARD"
                                }
                            }
                        ]
                    },
                    {
                        "type": "Text",
                        "id": "eventDateText",
                        "text": "${DS_NextEvent ? DS_NextEvent.eventDate : payload.nextEventDataSource.eventDate}",
                        "textAlign": "center",
                        "paddingTop": "${viewportSizeClass == @viewportClassMediumLarge ? @spacingLarge : @spacingSmall}",
                        "fontSize": "${viewportSizeClass == @viewportClassMediumXSmall ? @fontSize2XSmall : @fontSizeSmall}",
                        "onMount": [
                            {
                                "type": "SendEvent",
                                "arguments": [
                                    "localizeDate",
                                    "${DS_NextEvent.eventStartDateTime}"
                                ],
                                "flags": {
                                    "interactionMode": "INLINE"
                                }
                            }
                        ]
                    },
                    {
                        "type": "Text",
                        "text": "${DS_NextEvent ? DS_NextEvent.eventName : payload.nextEventDataSource.eventName}",
                        "textAlign": "center",
                        "paddingTop": "${viewportSizeClass == @viewportClassMediumLarge ? @spacingLarge : @spacingSmall}",
                        "fontSize": "${viewportSizeClass == @viewportClassMediumXSmall ? @fontSize2XSmall : @fontSizeSmall}"
                    },
                    {
                        "type": "Text",
                        "text": " ",
                        "textAlign": "center",
                        "paddingTop": "${viewportSizeClass == @viewportClassMediumLarge ? @spacingLarge : @spacingSmall}",
                        "fontSize": "@fontSize2XSmall"
                    },
                    {
                        "type": "Text",
                        "text": "${DS_NextEvent ? DS_NextEvent.eventLocation : payload.nextEventDataSource.eventLocation}",
                        "textAlign": "center",
                        "fontStyle": "italic",
                        "fontSize": "${viewportSizeClass == @viewportClassMediumXSmall ? @fontSize2XSmall : @fontSizeXSmall}"
                    },
                    {
                        "type": "Text",
                        "text": "${DS_NextEvent ? DS_NextEvent.eventLocationDetails : payload.nextEventDataSource.eventLocationDetails}",
                        "textAlign": "center",
                        "fontStyle": "normal",
                        "fontSize": "${viewportSizeClass == @viewportClassMediumXSmall ? @fontSize2XSmall : @fontSizeXSmall}"
                    },
                    {
                        "type": "AlexaFooterActionButton",
                        "id": "nextEventWidgetRefresh",
                        "buttonText": "${payload.nextEventDataSource.footerButtonText}",
                        "position": "absolute",
                        "bottom": 0,
                        "primaryAction": [
                            {
                                "type": "SendEvent",
                                "arguments": [
                                    "refreshEvent"
                                ],
                                "flags": {
                                    "interactionMode": "INLINE"
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    }
}

Widget manifest:

{
    "manifest": {
        "id": "NextEventWidget",
        "version": "1.0.0",
        "presentationDefinitions": [
            {
                "url": "presentations/default.tpl"
            }
        ],
        "installStateChanges": "INFORM",
        "updateStateChanges": "INFORM",
        "appliesTo": "${viewport.mode == 'HUB'}"
    },
    "packageVersion": "1.0",
    "packageType": "APL_PACKAGE",
    "publishingInformation": {
        "schemaVersion": "1.0",
        "locales": {
            "en-US": [
                {
                    "targetViewport": "WIDGET_M",
                    "metadata": {
                        "name": "Team Assist Next Event Widget",
                        "description": "Display the next event from Teamsnap.",
                        "keywords": [
                            "Team Assist",
                            "Teamsnap",
                            "TeamAssist"
                        ],
                        "iconUri": "https://d3ozx4qyxcxwzd.cloudfront.net/default_icon.png",
                        "previews": [
                            "https://d3ozx4qyxcxwzd.cloudfront.net/default_preview.png"
                        ]
                    }
                }
            ]
        }
    }
}
1

There are 1 answers

8
allthepies On

Is the widget version of the skill in development only ? Some of the PackageManager requests only get sent for live skills. This is definitely the case for the UpdateRequest as I got Amazon to add a note in the docs clarifying this. Perhaps they've made some changes and now the UsagesRemoved request doesn't get sent for dev skills (although I would doubt this).