-
Notifications
You must be signed in to change notification settings - Fork 733
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
Prevent file downloads if the disk would be full #8683
Prevent file downloads if the disk would be full #8683
Conversation
b590e82
to
d034d6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kolibri/utils/options.py
Outdated
"MINIMUM_DISK_SPACE": { | ||
"type": "integer", | ||
"default": 250000000, | ||
"description": """ | ||
The minimum free disk space in bytes that Kolibri should try to maintain on the device. This will | ||
be used as the floor value to prevent Kolibri completely filling the disk during file import. | ||
""", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we define this in MB (or maybe a decimal GB) to be a bit more user-friendly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main concern would be the frequent confusion between GiB and GB, and the fact that these may be used differently when people are examining their local disks. Using bytes is unambiguous if somewhat verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth:
- Android appears to report decimal
- MacOS reports decimal
- Ubuntu shows decimal in the GUI and
df
can show either
Windows is the only one that seems to still report base2
<UiAlert | ||
v-show="transferFileSize > availableSpace" | ||
:dismissible="false" | ||
type="error" | ||
> | ||
{{ spaceTranslator.$tr('notEnoughSpaceForChannelsWarning') }} | ||
</UiAlert> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filed a follow-up issue regarding in-page errors: #8690
cc @radinamatic regarding user docs and gherkins |
@pcenov We need to add the relevant Gherkin scenario to test this in (I presume) beta3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works great!
Minor suggestion regarding docs.
Co-authored-by: Devon Rueckner <[email protected]>
Summary
References
Fixes #6697 but with a slight deviation from the design to allow for direct string reuse.
Reviewer guidance
Does Kolibri prevent you from downloading files that would fill up your drive?
Does Kolibri error a task if the drive fills up while downloading? (download a large file independently to fill up the space).
To help with testing this, you can use the new option:
Will reserve 63GB of space on your disk that Kolibri will not attempt to use.
Animation of new interaction:
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)