-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
professional-lalit
wants to merge
5
commits into
TeamAmaze:release/4.0
Choose a base branch
from
professional-lalit:bugfix/3991
base: release/4.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Recent files doesn't display recent files #4067
professional-lalit
wants to merge
5
commits into
TeamAmaze:release/4.0
from
professional-lalit:bugfix/3991
+74
−29
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
changed the title
Bug: Recent files doesn't display recent files
Recent files doesn't display recent files
Jan 30, 2024
VishnuSanal
requested changes
Jul 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @professional-lalit thanks for your interest in contributing to amaze! it looks good to me, please address the review comments.
app/src/main/java/com/amaze/filemanager/asynchronous/asynctasks/LoadFilesListTask.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/amaze/filemanager/asynchronous/asynctasks/LoadFilesListTask.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/amaze/filemanager/asynchronous/asynctasks/LoadFilesListTask.java
Outdated
Show resolved
Hide resolved
app/src/main/java/com/amaze/filemanager/asynchronous/asynctasks/LoadFilesListTask.java
Outdated
Show resolved
Hide resolved
VishnuSanal
added
the
pr-requested-changes
this PR is awaiting an update from the author
label
Oct 13, 2024
since this PR is long inactive, I am taking this PR over. |
VishnuSanal
force-pushed
the
bugfix/3991
branch
from
October 13, 2024 16:20
cd1c20d
to
76fa5dc
Compare
VishnuSanal
added
pr-awaiting-initial-review
this PR is awaiting for an initial review
and removed
pr-requested-changes
this PR is awaiting an update from the author
labels
Oct 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 instorage/emulated0/
directory. The recently changed file would always come wrapped in some folder if created in a directory other thanstorage/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