https://metaplay.io logo
Is there a reason the credentials in
# general
s
Is there a reason the credentials in Android BlockStore aren't backed up to cloud by default?
j
Yes. If the device-credentials were backed in cloud, this would mean multiple devices could share their credentials. This would cause weird effects, such as when switching account on one device, it would also change on the other device too. On dashboard, you would also see only one Guest credentials, and cannot manage them separately. This is very surprising to both user and developers, and fixing this state is very difficult. Having said that, I realize we have actually added a mechanisms to prevent cross-device use. When we store the data to block store, we also store the ANDROID_ID of the device and refuse using it if the id is different. However, this sanity check also voids any benefit we would get from Cloud backup. I believe Cloud backup is only used in Factory reset. Factory reset also resets the ANDROID_ID, so even if we did back up the credentials, they are not usable on the resetted device. This means that if a user Factory Resets their device, their credentials are lost. This also means that if a user gets a new Android device, and migrates apps there, the credentials are not migrated to the new device. What use case did you have in mind with the Cloud Backup?
Sorry for double reply, I didn't create a thread initially
s
Nothing specific, I was just digging deeper into how the user credentials are persisted when users uninstall and re-install the app. And happened to notice that there's the possibility to use the BlockStore to actually share the credentials between devices. This is not an issue as there's other (and better/more reliable) ways to sync the account between devices. Does this work somehow differently on iOS? I think by default the keychain gets backed up to iCloud and as such the credentials are transferred between the user's devices.
Also touching the same subject, we previously had allowBackups = true in our AndroidManifest which caused broken behaviour at least when we did a fresh deployment of the server and cleared the database. On the device a user could not log in anymore, almost like the server didn't make them a new account . Any idea what data could there be in the app data folder that would cause this kind of behavior? We have the setting disabled now to prevent such issues.
j
On iOS, we don't use iCloud backup for the credential Keychain items. On iOS the keychain is synced more often than per-Factory-Reset so there the credentials getting mixed up is more prominent.
For the backup case, that sounds very unexpected. The client should be presented a new user account. Do you happen to remember the steps how to reproduce? Something like this: * App with allowBackups enabled * Play to server * Uninstall app * Reset Server database * Reinstall app In the data folder we store Credentials and a "DeviceGuid" marker file. But neither of these being "out-of-date" should prevent login... weird
s
It was nothing out of the ordinary, so should've been as you described. It was quite weird. But if I remember correctly, it only happened on certain devices, maybe some Sony phones? Maybe they do something extra/bit differently.
But alright, thanks for clarifying about the storages. Let's me focus on the other authentication methods instead of the local files as they seem to be taken care of quite well 👍
j
Sound very weird indeed. If this similar things happen again, try to see if there are anything weird in server logs or if there are player incidents reported. They might contain some clues. Also do reach out, failures to login a very critical for the product and we are very interested in debugging and fixing them 🙂 It's some time ago already but previously we had an issue where downloaded game config cache could be included in backups, and this could have used some amount of disk space. In some backup scenarios I think the system just stops backing up if size exceeds some limit, leaving the old version in the cloud. So it's possible the backup then was some ancient version. But even then the client should have handled the old data properly. Yeah, okay, this is not a great theory, unless Sony does something extra weird here...
s
I'll keep an eye out if we encounter anything similar, but this happened a while ago on a dated SDK. Thanks again for the clarifications