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

[BUG] Av.offline operation does not work correctly when run from a parent folder #4403

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Aitorbp
Copy link
Contributor

@Aitorbp Aitorbp commented May 10, 2024

Related Issues

App: #4402

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (No required)

QA

@Aitorbp Aitorbp self-assigned this May 10, 2024
@Aitorbp Aitorbp force-pushed the fix/av_offline_operation_does_not_work_when_run_from_parent_folder branch from da4b79a to 402f620 Compare May 13, 2024 06:56
…olderUseCase to added to the condition to syncs the content folder
@Aitorbp Aitorbp force-pushed the fix/av_offline_operation_does_not_work_when_run_from_parent_folder branch from 402f620 to 35ce6ba Compare May 13, 2024 07:16
@Aitorbp
Copy link
Contributor Author

Aitorbp commented May 13, 2024

Following this same use case:

  1. If we have the following tree of files in our account:
    Folder1
    File1 -> downloaded
    Folder2
    FIle2 -> downloaded
    File3 -> downloaded
  2. We delete the file file2 locally
  3. We go to the parent folder and set it to av.offline
  4. We wait for the process to finish and click on Unset available offline.
  5. We navigate to folder2 and observe that file2 has not been downloaded.

The problem is that when doing a Set available offline on a folder that has subfolders with downloaded files, the remote and local etag does not change, this is fine because there has been no remote change that updates the etag.

But in addition to that, another condition that we have for it to refresh the files in that folder will not be fulfit either. When we compared on Folder2 if the localChildToSync.localModificationTimestamp > remoteChild.lastSyncDateForData they will both result in 0 as this value for folders will always be zero.

Therefore, with the new logic there would be nothing to refresh and it will not synchronize the files contained in that subfolder.

Another option that was considered to fix this was to control the keepInSync parameter, but this is not updated until the end of the refresh function, when we have already received the files that we want to synchronize and sub folder2 is not among them.

To not further change the logic of the refreshFolder function as a conclusion, a new parameter in SynchronizeFolderUseCase called isActionSetFolderAvailableOffline set by default to false will be created. When we perform the operation it will be set to true and a refresh of all the contents of that folder will be performed.

@Aitorbp Aitorbp requested a review from JuancaG05 May 13, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Av.offline operation does not work correctly when run from a parent folder
1 participant