zhanghai / zhanghai/MaterialFiles

[Bug]: Search Results in Search Mode Fail to Auto - Refresh, Causing Inconsistencies with File Operations

Open
#1,394 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
9k
Forks
736
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When in search mode, the search results do not automatically refresh, causing file operations like creation, deletion, and modification not to reflect in the search results. This leads to inconsistencies where files do not show up, or deleted files still appear in the search results.

To Reproduce
Steps to reproduce the behavior:

  1. Open the app and create a file "file1" in any folder.
  2. Perform a search for "file" and see that "file1" appears in the search results.
  3. Create a file "file2", but the search results do not automatically refresh, so "file2" is not visible.
  4. Manually refresh the search, and "file2" appears.
  5. Delete "file2", but the search results do not automatically refresh, and "file2" remains in the list.
  6. Rename "file2", and an error is displayed.

Screen recording
https://github.com/user-attachments/assets/6716617d-9861-4459-995c-448b7e6fe095

Expected behavior
In search mode, any file operations (create, delete, rename) should immediately reflect in the search results, ensuring that the displayed files are up-to-date and avoiding errors like "No such file or directory."

Device Information:

  • Device: generic_x86_64 (Android Studio x86 emulator)
  • OS: Android 9

Suggested Fix Options

  1. After any file operation (create, delete, rename) within the path, trigger a re-search to refresh the search results.
  2. Alternatively, modify the search results dynamically after any file operation to keep the displayed results synchronized with the actual file system.

I look forward to your feedback and hope this can be addressed soon. Thank you for your attention to this matter!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the problem in the Android app's search mode using the create, delete, and rename steps described. Trace how file operations affect the displayed search results and verify that each operation keeps results synchronized, including removing deleted files and avoiding the reported missing-file error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.