actions-on-google / actions-on-google-nodejs

Node.js client library for Actions on Google
https://actions-on-google.github.io/actions-on-google-nodejs
Apache License 2.0
900 stars 197 forks source link

conv.user.storage clears out (doesn't store) data between sessions #359

Open dava-ua opened 4 years ago

dava-ua commented 4 years ago

Hi all,

I've been developing my "Action on Google" almost a year. This bug(feature?/unexpected behaviour) I've been observing last 2-3weeks. Before, storing into conv.user.storage worked as expected.

Steps to reproduce (env: simulator, "actions-on-google": "2.12.0", testing location: Germany):

  1. Ok, google, talk to -> gapp.intent('Default Welcome Intent', async (conv) => { if (!conv.user.storage || Object.keys(conv.user.storage).length === 0) { console.log('Default Welcome Intent -- New User'); conv.followup('selectNativeLanguage'); } else {...} });`

  2. User goes to the following intent and see the list of options

  3. User select an option: gapp.intent('Select Native Language - get', async (conv, input, option) => { conv.user.storage.nativeLang = option; // some logic.... });

  4. User goes further through the Action - conv.user.storage persists between conversation turns.

  5. User want quite the Action: say/type: "stop"

  6. I log last state of the conv.user.storage gapp.intent('actions_intent_CANCEL', (conv) => { console.log("actions_intent_CANCEL: ", JSON.stringify(conv.user.storage)); conv.close("Ciao!") }); Looks good: actions_intent_CANCEL: {"nativeLang":"en-US"}

  7. User return to the Action: Ok, google, talk to -> Logs shows conv.user.storage is empty. The bug/feature? always reprodusible for new sessions. Default Welcome Intent -- New User conv.user.storage: {}

Welcome Request example: { "user": { "locale": "en-Us", "lastSeen": "2019-09-26T08:08:05Z", "userVerificationStatus": "VERIFIED" }, "conversation": { "conversationId": "ABwppHGo_0OwMRusa2qgiclwE45MewfkOwU1ue3ohDkBIyJkBmemII0MMLczm61OHqsBQ4hwBA8iGm6s57U", "type": "NEW" }, "inputs": [ { "intent": "actions.intent.MAIN", "rawInputs": [ { "inputType": "KEYBOARD", "query": "talk to MyActionName" } ] } ], "surface": { "capabilities": [ { "name": "actions.capability.AUDIO_OUTPUT" }, { "name": "actions.capability.MEDIA_RESPONSE_AUDIO" }, { "name": "actions.capability.WEB_BROWSER" }, { "name": "actions.capability.SCREEN_OUTPUT" }, { "name": "actions.capability.ACCOUNT_LINKING" } ] }, "availableSurfaces": [ { "capabilities": [ { "name": "actions.capability.WEB_BROWSER" }, { "name": "actions.capability.AUDIO_OUTPUT" }, { "name": "actions.capability.SCREEN_OUTPUT" } ] } ] }

Since I struggle with that last 2 weeks and "googled" for the reason of the issue:

Could you please take a look at this issue and provide the fix or solution?

Best regards

Topias-Pratsam commented 4 years ago

This same problem exists for actions-on-google-java as well. Also user is "VERIFIED" and has all activity controls enabled.

Fleker commented 4 years ago

Duplicate of #358

wuelcas commented 4 years ago

@dava-ua Check again, I don't have the issue on my actions anymore

dava-ua commented 4 years ago

Yes, that's true - now it fixed. Thanks! Hopefully in the future on production that won't happen again.