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

Fix recycle bin filling up storage when deleting multiple items #2600

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mino260806
Copy link

The current implementation of BaseSimpleActivity.movePathsInRecycleBin moves all the selections into the recycle bin, and then deletes them all at once.
Say the selected items have a total size of 5GB and available space on the device is 2GB, if all are moved to recycle bin at once, storage will be filled up and the app is going to crash.

Hence, I made it so that the app deletes the moved items whenever the remaining space is not enough...

Example

Current implementation

5GB size -> copy 5GB recycle bin -> crash (5GB > 1GB) delete the old 5GB from storage
❌ crash

Suggested implementation

5GB size -> copy 2GB recycle bin -> delete the old 2GB from storage
3GB size -> copy 2GB recycle bin -> delete the old 2GB from storage
1GB size -> copy 1GB recycle bin -> delete the old 1GB from storage
✔ success

Affected issues

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.

None yet

1 participant