Catfriend1 / syncthing-android

Syncthing-Fork - A Syncthing Wrapper for Android.
Mozilla Public License 2.0
1.12k stars 39 forks source link

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 12 months ago

carstenhag commented 12 months ago

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

Further Information

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

Catfriend1 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 3 months ago

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

Catfriend1 commented 3 months ago

Yes it's possible.

austinbutler commented 3 months ago

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