alexa / alexa-skills-kit-sdk-for-nodejs

The Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
Apache License 2.0
3.12k stars 736 forks source link

Custom attributes stored in DynamoDB disappear at random. #126

Closed kevinkey619b closed 7 years ago

kevinkey619b commented 7 years ago

Hi,

Is anyone else experiencing custom attributes stored in DynamoDB disappearing at random?

I'm using very simple code to set the attributes:

this.attributes.myCustom = '1234'; self.emit(':saveState', true);

The above lines are (supposedly) only executed during a very specific intent. Sometimes the data persists in DynamoDB for a few days and other times it last for hours, and sometimes it disappears in 15 minutes.

When the data goes away, the mapAttr values in the database becomes {}

Has anyone else experienced this?

knowlsie commented 7 years ago

Not had this issue personally. Do remember however, that the SDK will save your attributes at the end of the session anyway, independently of whether you call this.emit(':saveState'). As a result, I'd make a pretty good guess that your other sessions (that don't emit ':saveState') may still be overwriting your attributes... (I personally would avoid using ':saveState:' altogether, and just use that 'saving attributes at the end of sessions' functionality, because of https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/issues/88.)

If it's something other than that, it's almost certainly not an issue with the SDK code, so this may not be the best place to ask. Leave this issue open for now anyway in case any other skill devs happen to have experienced this.

knowlsie commented 7 years ago

On the other hand, I can confirm that stuff in DynamoDB doesn't just disappear at random.

kevinkey619b commented 7 years ago

@knowlsie Yeah, after further investigation I found that the attributes only disappear when my skill exits abnormally. Going to close this.

knowlsie commented 7 years ago

Good to hear you solved it.