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

Warn users when they run out of space #656

Merged
merged 9 commits into from
May 14, 2024

Conversation

grote
Copy link
Collaborator

@grote grote commented May 7, 2024

This PR takes two approaches for warning the user about out of space situations:

  1. try to retrieve actual free space from backup location and warn the user before attempting a backup if this is very low. some hacks are used to get the free space from external storage SAF providers
  2. catch exceptions that include hints about out of storage situations and then warn the user as soon as such an exception happens. Note that SAF does not always expose those exceptions to the caller.

Related to #363
Fixes #555

@grote grote requested review from stevesoltys and t-m-w May 7, 2024 18:44
@t-m-w
Copy link
Collaborator

t-m-w commented May 8, 2024

  1. try to retrieve actual free space from backup location and warn the user before attempting a backup if this is very low. some hacks are used to get the free space from external storage SAF providers

Tested this portion with a flash drive, and it looks like it's working fine. Free space is also shown when selecting a backup location, and backup sizes are shown when restoring.

@t-m-w
Copy link
Collaborator

t-m-w commented May 8, 2024

  1. catch exceptions that include hints about out of storage situations and then warn the user as soon as such an exception happens. Note that SAF does not always expose those exceptions to the caller.

Tested this by setting MIN_FREE_SPACE to -1 and recompiling. Seems to not notice an IOException for ENOSPC (caused by ErrnoException for ENOSPC) and waits a few minutes until timing out with a generic "Backup failed." Full log provided privately.

@grote
Copy link
Collaborator Author

grote commented May 9, 2024

Seems to not notice an IOException for ENOSPC

This helped me to identify additional out of space situations,we can now warn the user about. Pushed those as extra commits.

@chirayudesai chirayudesai merged commit bb562a4 into seedvault-app:android14 May 14, 2024
3 checks passed
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.

Handle USB out of storage files backup error
4 participants