TeamAmaze / TeamAmaze/AmazeFileManager

NOT fully overwrite files when copy

Open
#2,998 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-FileOperations Issue-Bug Issue-Severe (high)
Dominant language
Kotlin
Stars
6.4k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
1

Description

Describe the bug

Recently I found AFM not work as expected when copy some plain text files, the contents in the copied file seem not fully overwritten. In my case, I copy the src file foo.txt to annother folder, which contains a the dest file named foo.txt as well. Both two txt files have diffrent text contents. When I excute the copy-paste action and then click overwrite button in the paste confirm dialog, the job finish without any exception. But when I open the copied txt file(the new dest txt file that should be overwritten), I find the contents of both the src txt file and the dest txt file which before the overwrite.

To Reproduce

Steps to reproduce the behavior:

  1. Create a foo.txt in path /some-test-path-1 with content 'aaa';
  2. Create another foo.txt in path /some-test-path-2 with content 'bbbbbb';
  3. Copy the /some-test-path-1/foo.txt and then paste in folder /some-test-path-2, click 'overwrite' button in the next confirm dialog;
  4. Open the /some-test-path-2/foo.txt after the copy-paste job finish, then you will see weird content 'aaabbb' instead of 'aaa'

Expected behavior

The original file should be fully overwritten by the src file content. In the reproduce case above, that should be 'aaa'.

Screenshots

None

Smartphone (please complete the following information):

  • Device: Google Pixel 5
  • OS: Android 11
  • Rooted: No
  • Version: 3.6.5

Additional context

None

Contributor guide

Open the contributing guide

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

Start by reproducing the copy-and-overwrite flow on Android 11 with the described foo.txt contents, then trace the file-copy path used by the paste confirmation. Done means overwriting a longer destination file leaves exactly the source contents, with no trailing destination bytes.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.