nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.19k stars 1.75k forks source link

Multi Account: When switching to other Account all downloaded data from previous account is being deleted locally #11022

Open fabolhak opened 1 year ago

fabolhak commented 1 year ago

⚠️ Before posting ⚠️

Steps to reproduce

  1. Configure two accounts
  2. Download some data locally on first account
  3. Switch to second account
  4. force close app in settings (not sure if that is needed)
  5. Open App again
  6. Switch back to first user

Expected behaviour

Locally downloaded data for first user should still be available.

Actual behaviour

All downloads from first user deleted. Needs manual download again.

Android version

9

Device brand and model

Xiaomi Mi A1

Stock or custom OS?

Stock

Nextcloud android app version

3.22.3

Nextcloud server version

24.0.7

Using a reverse proxy?

Yes

Android logs

No response

Server error logs

No response

Additional information

Not sure if this behavior is intended or not. For me it feels like a bug. Can provide further logs if necessary :)

AlvaroBrey commented 1 year ago

Cannot reproduce. Can you get a logcat from the Android device so we can see if there's any errors? Instructions here: https://github.com/nextcloud/android/blob/master/README.md#getting-debug-info-via-logcat-mag

Feel free to search and replace the server URL, username and other file names in the output.

fabolhak commented 1 year ago

Hello, thank you for the quick reply. It took me a while to generate the logs and strip all personal information.

What I basically did:

  1. Initially logged in at user@first.account
  2. Switched to user@second.account
  3. Switched back to user@first.account

I had to manually download the file SomeFolder/SomeFile after I was switching back to first.account. Even though, it was already downloaded before all the switching.

Hope you can find something useful out of the logs. Let me know if there is anything missing.

nextcloud.log

mrjohnson22 commented 1 year ago

This has been happening to me since at least September, also on Android 9. Thank you for finding the repro conditions for this! It's nice to finally know why my files keep disappearing...

I can reproduce the file deletion with the steps given, without having to force-kill the app.

If another logcat is needed to help debug this, I can generate one too.

tomdereub commented 1 year ago

I have the same issue with local files sometimes deleted without knowing why, but I can't reproduce with the steps given. So for the moment I don't know why my files keep disappearing, it happens about a few times per year...

joshtrichards commented 9 months ago

@tomdereub Are you also on Android 9?

tomdereub commented 9 months ago

@joshtrichards I'm on adroid 12 (lineageos 19.1).

fabolhak commented 9 months ago

I bought a new phone which runs LineageOS 20. The issue disappeared for me and everything works fine now. I guess it was probably due to some resource limitation on my old phone which was quite old.

Not sure if I should close the issue now or keep it open.

mrjohnson22 commented 8 months ago

I can confirm this still happens to me (on the same device it occurred for me the last time I commented here).

Interestingly, Android's native "Open from" file picker is able to sync files from Nextcloud accounts other than the primary account that the app is logged into, and local files from any account persist on the device. The only action that wipes all of an account's local files is using the Nextcloud app to switch to a different primary account.

mrjohnson22 commented 6 months ago

Update: this issue does not happen on some Android 14 phones I've installed the app on. This is consistent with the issue being absent on LineageOS 20.

Could the issue be related to Android APIs and not just resource limitations?