Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Device Backup: After restoring the backup to a new phone, it resulted in 2 phones having the same device ID #999

Open
carstenhag opened this issue Jul 15, 2023 · 6 comments

Comments

@carstenhag
Copy link

carstenhag commented Jul 15, 2023

Description of the issue

I used Syncthing-fork on my Android Phone A. This one is backup up with the built-in Google Backup system.
Today I set up my new phone B, which restored the backup from phone A.

Turns out that Syncthing-fork in my opinion backs up too much data and automatically restores it. It saved the folder and the remote device, that was set up on Phone A. So far so good.

But it also backed up & restored the device ID. I was not sure what exactly happened, but clearly Syncthing was not happy with 3 devices, 2 of them having the same device ID :D.

Reproduction Steps

  1. Set up Syncthing-Fork on Phone A. Force backup as per Android docs
  2. Restore backup (can be done either on Phone A or B, depends on what you want to do specifically to troubleshoot).
  3. See the device ID being duplicated

Version Information

  • App Version: v1.23.5.1
  • Syncthing Version: v1.23.5
  • Phone A: OnePlus 8, Android 12
  • Phone B: Poco F5, Android 13

Further Information

Check the bacup & restore testing documentation at https://developer.android.com/guide/topics/data/testingbackup

@carstenhag carstenhag changed the title Google Device Backup: After restoring the backup to a new phone, it resulted in 2 phones having the same ID Google Device Backup: After restoring the backup to a new phone, it resulted in 2 phones having the same device ID Jul 15, 2023
@Catfriend1
Copy link
Owner

Hi ,

This is only applicable if you replace phone A by B. What should happen instead? I think you should setup your new device with syncthing from scratch. We'll never know if it's replace or a new node intended.

@carstenhag
Copy link
Author

I think you should setup your new device with syncthing from scratch.

Exactly. So one way to do this would be to entirely disable backups from the app.

Or a new flag gets introduced that gets persisted, but not backed up.
The app then knows on app launch, that the flag is not set but that data exists. The app can then ask the user if they want the backed up data (possibly from another phone!) to be restored or not.
It could also restore everything, but just generate a new device ID.

@Catfriend1
Copy link
Owner

Okay, this sounds reasonable. We can do this if someone has motivation to do a pr and experiment with the Google backup feature . I don't use this feature myself.

@austinbutler
Copy link

Same issue. Is it possible to just generate a new device ID?

@Catfriend1
Copy link
Owner

Yes it's possible.

@austinbutler
Copy link

I should have been more exact, how can one change the device ID on the Android app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants