r/GoogleAssistantDev • • 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

8 Upvotes

8 comments sorted by

1

u/[deleted] Sep 23 '19

I have been emailing their support team for a few days and this is what they have come back with:

Thank you for your response.As you have mentioned "Activity controls > Web & App Activity > Include Chrome history and activity from sites, apps, and devices that use Google services" has to be toggled on in order for the user-storage to work as intended.  This information has to be updated in the documentation. We have passed this information to our documentation team. Regarding the user disabled their Web & App Activity the user will be set as GUEST. If a user's verification status is GUEST, then account management with Account Linking and accessing userStorage will both fail.

1

u/adamcohenrose Sep 26 '19

Looks like this is (now?) documented at https://support.google.com/googlenest/answer/7382500

I've also got a support ticket open. Got the usual "please reply with steps to repeat, screenshot, logs, dialogflow export, etc" -- quite frustrating given that I included logs and detailed description in the previous email.

Our stackdriver logs are showing quite clearly that we're setting userStorage in response to requests from VERIFIED users, and that the very next request coming through from that user has no userStorage.

2

u/LeonFromGoogle Googler Oct 01 '19

A fix for userStorage is now in production. Apologies for the disruption.

1

u/polohero Oct 03 '19

Hey Leon. I don't believe it's fixed. Still getting reports. I did notice the user was from UK if that changes anything.

1

u/goldzulu Sep 16 '19

Hmm this is a worry and might explain a weird behaviour that I had with one of my action that relies on the userStorage. I would assume that once verified then userstorage can be used and thats only thing you need to check. Did you factor out different networking environments? How about voice matching? Not sure if a person has multiuser turned on and how this will impact session storage. Anyway I am still new to this. Just curious to see if there is a resolution as well to this. Nice action by the way.

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

1

u/[deleted] Sep 16 '19

I've already filed a bug with their support team. I suggest you all do the same.

https://developers.google.com/actions/support/