owncloud / android

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

[FIX] Unwanted DELETE operations when synchronization in single file fails #4408

Closed JuancaG05 closed 1 month ago

JuancaG05 commented 1 month ago

When performing a read remote file operation (synchronization over a single file), if the account in the OwncloudClient is null, we'll throw an AccountNotFoundException. This will be handled in 3 different views:

In the 3 cases, we'll show a Snackbar telling Sync failed, you need to log in again, suggesting that by repeating the login process, the problem can be solved (since we'll save again the account, which might have been lost in some migration process from a very old version).

Also, we changed the way to handle the 404 error of a PROPFIND. Previously, we deleted locally and remotely the file that we requested in the PROPFIND, now we just remove it locally (since if we receive a 404, the file shouldn't exist in remote), avoiding sending DELETE requests.

Related Issues

App: https://github.com/owncloud/enterprise/issues/6638


QA

TheOneRing commented 1 month ago

Sounds good to me

jesmrec commented 1 month ago

Not able to reproduce the problem of the non-existing account without tricking the code. Users' feedback turns important here, because this is not an expected behaviour and it is not in our hands to control it (OS feature).

About the DELETE sent after a 404, it's fixed. DELETE remote operation is not sent anymore, and local copy is removed 👍

jesmrec commented 1 month ago

Just a question here:

In the 3 cases, we'll show a Snackbar telling Sync failed, you need to log in again

When auth is lost due to an invalid token, we use to show a snackbar with the message and a button/link that prompts the user to the login view. How difficult is to add that button to the snackbar in the same way? like:

Screenshot 2024-05-24 at 12 48 38

JuancaG05 commented 1 month ago

Just a question here:

In the 3 cases, we'll show a Snackbar telling Sync failed, you need to log in again

When auth is lost due to an invalid token, we use to show a snackbar with the message and a button/link that prompts the user to the login view. How difficult is to add that button to the snackbar in the same way? like:

Screenshot 2024-05-24 at 12 48 38

Should be added now 😃

jesmrec commented 1 month ago

Should be added now 😃

Correctly added and working in list of files, details view and image preview. Ready to go.