question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Throw warnings for exceeding known platform limitations

See original GitHub issue

Not sure if this belongs here or in alexa-app-server.

I spent the last three and a half weeks discovering/troubleshooting the 24k response size limit. Could warnings be thrown in the console so developers would have some clue that the same code will fail on an Alexa device?

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference

Response Format

This section documents the format of the response that your service returns. The service for an Alexa skill must send its response in JSON format.

Note the following size limitations for the response:

  • The outputSpeech response cannot exceed 8000 characters.
  • All of the text included in a card cannot exceed 8000 characters. This includes the title, content, text, and image URLs.
  • An image URL (smallImageUrl or largeImageUrl) cannot exceed 2000 characters.
  • The token included in an audioItem.stream for the AudioPlayer.Play directive cannot exceed 1024 characters.
  • The url included in an audioItem.stream for the AudioPlayer.Play directive cannot exceed 8000 characters.
  • The total size of your response cannot exceed 24 kilobytes.

If your response exceeds these limits, the Alexa service returns an error.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
nickcourycommented, Jul 29, 2017

I’ll add another related case. Only certain characters are allowed to be spoken within SSML responses, and if invalid characters are passed it errors the response. I’ve run into a number of times when pulling data from other APIs that include user input.

As a (very) rough illustration, I’ve been using the following RegEx/JavaScript blacklist to filter out some bad characters. It might be worth it to automatically clean the SSML code to make sure it will be valid, perhaps with a good whitelist.

It would likely be optional or a secondary function such as .validatedSay(), given there are a variety of ways to either substitute or remove the text. Would maybe be best as an add-on library even.

Example: text = (text || '').replace(/[^\w\s/<>.,-"']/gi, '').replace('&', 'and').replace('=', 'equals').replace('@', 'at');

0reactions
jlguinncommented, Feb 12, 2017

I’ll take a stab. I created the fork and now it looks like I have some tuts to catch up on writing tests, but this seems like a good spot for me to get started. Thanks for the link.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compiler Warnings by compiler version | Microsoft Learn
This option only suppresses warnings, not new error messages. Don't suppress all new warnings permanently! We recommend you always compile at ...
Read more >
Warning Options (Using the GNU Compiler Collection (GCC))
3.8 Options to Request or Suppress Warnings. Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky ......
Read more >
Runtime warnings and convergence problems - Stan
Here we walk through the types of warnings and hints to help you diagnose and resolve underlying modelling problems.
Read more >
Error Messages in Maps Static API - Google Developers
The Maps Static API may issue an error or warning when something goes wrong. ... such an error condition is when the application...
Read more >
LaTeX/Errors and Warnings - Wikibooks
It may also display warnings for less serious conditions. Don't panic if you see error messages: it is very common to mistype or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found