Open chandora opened 3 years ago
Hi @chandora, thanks for raising this issue. I will reach out to the concerned team regarding this issue and revert back.
Hey @chandora can you tell me your skill Id ?
@Shreyas-vgr and @sattpat
Thank you for your investigation. My skill Id is as follows:
amzn1.ask.skill.baad1b9a-fff8-458b-925b-b95d1bf6749b
Please note that the skill has been published, and I experienced the issue with one in the development stage being updated for the next release.
If you need to check a log for the issue, please let me know. I will re-run the test case to reproduce the issue.
Thank you,
Hey @chandora , I didnt read the your entire issue the first time. So just to be clear, your local debug connection is working for launch intents only? What about other intent requests?
How are you invoking the Skill Messaging API? How did you verify that the the skill requests are not making it to your debug connection? I am online on Gitter. So feel free to ping me there so that we can coordinate a simulation if it comes down to that.
@sattpat
Thank you for your reply. As we are in different timezones (I am in Japan), it seems to be difficult to contact you via Gitter.
My local debug connection is not working only for Launch intent but also for other requests. They include request types for LaunchRequest, IntentRequest, Alexa.Presentation.APL.UserEvent and Connections.Response (AskFor). I confirmed it by checking log messages from my code and SDK in the debug console of VS Code.
I could not see any log message in the debug console, neither from my code nor SDK, when I invoked the Skill Messaging API. After some investigation, I found log messages from my code for Messaging. MessageReceived request in the ClouldWatch log for the same skill running in the Alexa-Hosted environment. They were logged while other requests were received in the local debugging environment.
I invoked Skill Messaging API using SDK. Without the local debug connection, all requests including Skill Messaging API are routed to the skill in the Alexa-Hosted environment. So I assume my procedure of using the API is okay.
Just in case, the following is the code using Skill Messaging API. (I am developing a test driver for skills, and the Skill Messaging API is invoked to load test data to S3 store.)
import as Alexa from 'ask-sdk-core'; import as Model from 'ask-sdk-model';
export async function setupTestDataRemotely(medicationData: MDEF.MedicationData | undefined) { assert.isDefined(medicationData, 'Medication Data Undefined'); assert.isNotNull(medicationData, 'Medication Data Null');
const clientId = config.messaging_client_id;
const clientSecret = config.messaging_client_secret;
const userId = config.user_id;
const apiConfiguration: Model.services.ApiConfiguration = {
apiClient: new Alexa.DefaultApiClient(),
apiEndpoint: 'https://api.fe.amazonalexa.com',
authorizationValue: ""
};
const authentificationConfiguration: Model.services.AuthenticationConfiguration = {
clientId,
clientSecret
};
const serviceClient = new Model.services.skillMessaging.SkillMessagingServiceClient(
apiConfiguration,
authentificationConfiguration);
const message: Model.services.skillMessaging.SendSkillMessagingRequest = {
data: medicationData,
expiresAfterSeconds: 60
};
try {
await serviceClient.sendSkillMessage(userId, message);
}
catch (error) {
console.log(JSON.stringify(error, null, 2));
throw error;
}
}
Hi @chandora, thanks for the detailed steps to reproduce the issue, can you also share the local debug configuration snippet you are executing from VSCode ?
I looked at the logs and I will list my observations here.
check point 3 under https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/vs-code-testing-simulator.html#prepare-test
@sattpat and @Shreyas-vgr ,
I attach the debug configuration below. As you can see, it is pointing to FE region.
As my account was made in amazon.co.jp's Web site, I guess my account is in FE (but not sure). The request messages coming to my skill contain "apiEndPoint": "https://api.fe.amazonalexa.com".
I am invoking the skill from the developer console, VS Code, and my test driver running on Node using SMAPI and Skill Messaging API. The normal skill requests from them like LaunchRequest, IntentRequest ... are received by the local skill. Only the message from the Skill Messaging API is not received.
In addition, the message sent via Skill Messaging API (pointing to FE) is received by the host skill.
So I infer the connection to FE is correct and the issue seems to be specific to the connection for the Skill Messaging API.
I see some successful skill requests coming through
At the beginning of local-debug experience (a couple of months ago), it was pointed to NA and did not work. If you mean that you saw messages coming to NA, is it possible you saw messages sent in that old configuration?
{
"name": "Debug Alexa Skill (Node.js)",
"type": "node",
"request": "launch",
"program": "${command:ask.debugAdapterPath}",
"outputCapture": "std",
"args": [
"--accessToken",
"${command:ask.accessToken}",
"--skillId",
"${command:ask.skillIdFromWorkspace}",
"--handlerName",
"handler",
"--skillEntryFile",
"${workspaceFolder}/lambda/index.js",
"--region",
"FE"
],
"cwd": "${workspaceFolder}/lambda",
"envFile": "${workspaceFolder}/lambda/test/.env"
}
Hello, I'm experiencing a similar issue, I can't get any of my requests routed to my local machine.
I followed the instructions here: https://developer.amazon.com/en-US/docs/alexa/smapi/ask-cli-intro.html#test-locally
ask run
works as expected:
*****Once the session is successfully started, you can use `ask dialog` to make simulation requests to your local skill code*****
Region chosen: NA
*****Starting Skill Debug Session*****
*****Session will last for 1 hour*****
But running ask dialog
, or even ask dialog -g development -l en-US
connects to the deployed version of the skill and is unaffected by local code changes.
My skill ID is amzn1.ask.skill.c6ecc7f8-ee7a-4518-9798-4c1229ed7d5b
I'm based in the UK, which is where I originally opened my amazon dev account, but I've set my skill up with the en-US locality and use the NA region.
Is this issue/feature-request still relevant? We are working on prioritization of relevant issues and cleanup of rest. If we don’t hear back in 2 weeks, we will assume that the issue is not relevant and we will close it.
Hi, I have given up using Skill Messaging API, so it is no longer relevant to me.
I'm submitting a...
The Skill Messaging API does not send a message to a skill when the skill is running in a local environment with Alexa Skills Toolkit (ask-sdk-local-debug) on VS Code.
Expected Behavior
The Skill Messaging API sends a message to a skill running in a local environment.
Current Behavior
A message sent via Skill Messaging API is not routed to a skill running in VS Code with Alexa Skills Toolkit (ask-sdk-local-debug). Instead, the message is routed to the skill running in the Alexa-hosted environment. Other messages like LaunchIntent request are sent to the skill in the local environment as expected.
Possible Solution
Steps to Reproduce (for bugs)
Context
Your Environment
Node.js and NPM Info