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

Recent files doesn't display recent files #4067

Open
wants to merge 1 commit into
base: release/4.0
Choose a base branch
from

Conversation

professional-lalit
Copy link

RCA -

There was a check in LoadFilesListTask.listRecentFiles() that only list the file if it is not directory, which is not a case if file is not created in storage/emulated0/ directory. The recently changed file would always come wrapped in some folder if created in a directory other than storage/emulated/0/. Which was causing this issue.

Resolution -

In the solution provided it is assumed that we have to only show the files that were modified, hence, only modified/created files are listed and not the folders (as the title suggests ‘Recent Files’). Here, if the file is wrapped in a directory, the directory is recursively explored to check the files it contains. As we loop around recursively we go on adding the files that we find in a final list that is to be returned.

In this code, every file that comes from cursor will always be wrapped in some folder and it will be explored recursively and listed.

Description

Issue tracker

Fixes #3991

Manual tests

  • Done

  • Device: Android Studio Emulator

  • OS: Android 11 ("R") API 30

Build tasks success

Successfully running following tasks on local:

  • ./gradlew assembledebug
  • ./gradlew spotlessCheck

RCA -

There was a check in `LoadFilesListTask.listRecentFiles()` that only list the file if it is not directory, which is not a case if file is not created in `storage/emulated0/` directory. The recently changed file would always come wrapped in some folder if created in a directory other than `storage/emulated0/`. Which was causing this issue.

Resolution -

In the solution provided it is assumed that we have to only show the files that were modified, hence, only modified/created files are listed and not the folders (as the title suggests ‘Recent Files’).
Here, if the file is wrapped in a directory, the directory is recursively explored to check the files it contains.
As we loop around recursively we go on adding the files that we find in a final list that is to be returned.

In this code, every file that comes from cursor will always be wrapped in some folder and it will be explored recursively and listed.
@professional-lalit professional-lalit changed the title Bug: Recent files doesn't display recent files Recent files doesn't display recent files Jan 30, 2024
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: Recent files doesn't display recent files
1 participant