r/GoogleAssistantDev • u/adamcohenrose • Sep 16 '19
userStorage missing from subsequent requests
Our action speaks a warning message the first time that a customer uses it -- and we use userStorage to store a flag indicating that the message has been played.
We've been getting several reports that customers are being played that warning message every time they use the action -- and we can see in our logs that we're not receiving a userStorage field in the request at all.
This is odd as we definitely have verified users who have enabled their Web & App Activity history -- they must be verified as we use account linking and we are getting accessTokens in the requests.
To test what was happening, I set up a brand new Google account and called our action. I could see from our logs that we played the warning message and set the flag in userStorage -- and then the next time I called the action, Actions on Google didn't send the userStorage at all. This behaviour happened consistently until I returned a few hours later and tried again, when all of a sudden Google started sending through the userStorage.
I've just run a further test today and can see requests coming through from the AoG simulator without a userStorage. The responses set values on the userStorage and the subsequent requests come through without a userStorage again.
Are we missing something? Is userStorage inherently unreliable and should we switch to a database keyed off our linked account? Or is something going wrong on Google's side?
Found a StackOverflow post that seems to discuss a similar issue: https://stackoverflow.com/questions/52779281/storing-data-across-conversations-in-google-action -- the suggestion about Personal Results is not applicable as this setting is definitely turned on for all of the accounts I've tested.
Thanks to anyone who can help out!
Adam
1
u/[deleted] Sep 16 '19 edited Sep 16 '19
Posted about this the other day.
From what I have found, what you are seeing is due an Activity Controls setting being toggled off. AFAIK this shouldn't be required and I believe this is a bug. Specifically the "Include Chrome history and activity from sites, apps, and devices that use Google services" setting under "Web & App Activity".
You can at least get yourself and testers up and running by checking the checkbox under "Web & App Activity". This should get you userStorage back from what my testing has shown.
IMO this isn't a long term solution as userStorage is, at minimum, a requirement for anonymous user identifiers and AFAIK while "Web & App Activity" is toggled on by default (correct me if I'm wrong here) the checkbox isn't.
It's also worth noting that users will not come back as GUEST status despite that being the case for having the entire "Web & App Activity" setting disabled.
Activity Controls link:
https://myaccount.google.com/activitycontrols?pli=1
userStorage docs:
https://developers.google.com/actions/assistant/save-data#user_storage_expiration
edited to be more specific