owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.76k stars 3.09k forks source link

[BUG] "Remove local storage" observer is not working properly #4427

Open JuancaG05 opened 1 week ago

JuancaG05 commented 1 week ago

Actual behaviour

Currently, when getting to the "Remove local storage" dialog through the "Manage accounts" dialog, the "Clean data" button has the correct effect but we can't see the loading indicator while it is being executed, as we specified on the code.

Expected behaviour

When the work of removing the local storage of an account is being executed, show the loading indicator until it is finished.

Steps to reproduce

  1. Press the avatar to get to the "Manage accounts" dialog
  2. Press the broom icon of one of the accounts there
  3. Press "Clean data"

Can this problem be reproduced with the official owncloud server? (url: https://demo.owncloud.org, user: test, password: test) Yes, server doesn't mind in this case

Environment data

Android version: 9

Device model: Samsung Galaxy S9

Stock or customized system: Stock

ownCloud app version: 4.2.2 (8ec7a7009)

ownCloud server version: Doesn't mind

Additional context

All of this should happen in the subscribeToViewModels function inside ManageAccountsDialogFragment, but it seems that the event that arrives here is always null. We need to check why cleanAccountLocalStorageFlow is not updated properly (maybe threads issue), and if MutableStateFlow<Event<UIResult<Unit>>?> is the suitable type for this Flow.