Repository navigation
[ai] hidden files: Rewrite hidden paths after rename - #4802
Open
sanketpatel32 wants to merge 1 commit into
Open
sanketpatel32 wants to merge 1 commit into
sanketpatel32 wants to merge 1 commit into
Conversation
Renaming a file or directory left hidden entries pointing at the old path. Exact hidden entries then became visible after parent directory renames, while the Hidden Files dialog continued showing paths that no longer existed. Rewrite exact and descendant hidden paths in both the in-memory radix tree and utilities database after a successful rename. Descendant matching requires a trailing slash so sibling paths sharing the same name prefix are left unchanged. Fixes TeamAmaze#4794.
This file contains hidden or 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
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.
Fixes: #4794
Fixes #4794
Description
Hidden-file entries are keyed by exact paths. After a successful rename, both the in-memory radix tree and the utilities database still referenced the old path, so a file hidden inside a renamed directory became visible and the Hidden Files dialog kept showing a path that no longer existed.
This change rewrites exact hidden paths and descendant paths after a successful rename. Descendant matching requires a path boundary, so sibling paths such as
Reports-oldare not rewritten. Moves throughMoveFilesare intentionally unchanged; this PR is scoped to the rename flow described in the issue.Issue tracker
Fixes #4794
Automatic tests
Test plan:
./gradlew testPlayDebugUnitTest -x :testShared:testPlayDebugUnitTest --tests 'com.amaze.filemanager.database.UtilsHandlerTest' --tests 'com.amaze.filemanager.utils.DataUtilsTest'./gradlew :app:testPlayDebugUnitTest --tests 'com.amaze.filemanager.database.UtilsHandlerTest' --tests 'com.amaze.filemanager.utils.DataUtilsTest'Manual tests
Done
Device: Not run
OS: Not run
Build tasks success
Successfully running following tasks on local:
./gradlew assembleDebug./gradlew spotlessCheckGenerative code
This PR used generative code tools (GenAI, LLMs, etc.)
Model: Devin
Version: Not disclosed to the agent
Provider: Cognition AI
Self-review
git grepfor remaining occurrences)