Skip to content
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

Error handling for the case of a Response larger than 24kb #67

Closed
dly9014 opened this issue Feb 25, 2017 · 3 comments
Closed

Error handling for the case of a Response larger than 24kb #67

dly9014 opened this issue Feb 25, 2017 · 3 comments

Comments

@dly9014
Copy link

dly9014 commented Feb 25, 2017

Need to add error handling to throw an error if a Request is packaged up that will result in the the Response being larger than 24 kilobytes.

I'm getting intent failures with no corresponding errors. In troubleshooting I've found that in certain cases I am exceeding the max allowed size of the JSON Response object. I see from the docs that the total size of your response cannot exceed 24 kilobytes.

Is there any way to store more than 24kb between intents in a session and not pass it in as part of the JSON Request object? Obviously if it goes in to the request it is going to come out as part of the response object and exceed the size limit.

I already persist data with DynamoDB, pulling in data to a new session each time. I have a workaround for the issue above to check if max allowable size is exceeded and if so to set this.attributes = null before this.emit(':ask/tell') and then reload them from the DB when the response comes back, but I don't want to have to go to the DB after every intent in the same session!

Also what is the object that I can refer to with something like (JSON.stringify(this.).length​ to get the full size of the JSON request object (not just the size of attributes)?

@waiwong614
Copy link

Hi,
Were you able to figure this out? I'm also running into the dreaded cannot exceed 24 Kilobytes issues.
Thanks,

@dly9014
Copy link
Author

dly9014 commented Mar 31, 2017

I have a workaround as described above. Does it make sense for you? To get the full size of the JSON Request object Brian@Amazon suggested something like this on alexaResponse in https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/blob/master/lib/response.js

@ghost
Copy link

ghost commented Apr 7, 2017

@dly9014 If you have a large skill state, one idea would to have your skill store state in a dynamodb table instead of through session attributes. This would bump you up to a 400KB limit according to (dynamoDB documentation)

I'm closing this for now but feel free to re-open if you have more questions

@ghost ghost closed this as completed Apr 7, 2017
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants