Skip to content

Conversation

@Keerthipati-Harshith-Varma

Task/Issue URL
N/A (Internal enhancement – improves file deletion reliability and logging)

Description
This PR enhances the AndroidFileDeleter implementation by adding structured error handling, detailed logging, and improved coroutine usage.
It ensures better visibility, safety, and maintainability for all file deletion operations across the app.

Key changes:
1.Added runCatching blocks for structured exception handling.
2.Introduced per-file deletion success/failure tracking.
3.Enhanced log messages with INFO/ERROR priorities.
4.Implemented summary logs showing number of successful deletions.
5.Ensured all operations run in dispatchers.io() context to avoid blocking the main thread.
6.Improved readability with clear filtering and early returns.

Steps to test this PR
Feature: Enhanced File Deletion Logging
Trigger file deletion in a directory (e.g., cache or temp folder).
Verify that deleted files are logged with success messages.
Verify that failed deletions log detailed error messages without crashing.
Check log summary shows accurate count of deleted vs attempted files.
Confirm that excluded files remain untouched.

UI changes
Before
(No visible UI changes — internal logic update)
After
(No visible UI changes — improved backend behavior)

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.

1 participant