Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
If you go to the settings and try to type a valid full path with drive letters into the cache path field, it silently gets "stuck" after the drive letter behind the scenes. Upon re-opening the settings the field is blank and can't be edited:
The setting saved to disk is like:
Installing mods then fails with some strange text about a
System Volume Information
folder:Cause
TrySetupCache
is supposed to determine whether a cache path is valid, but an exception was being thrown inNetModuleCache.GetSizeInfo
when the path wasE:
, afterTrySetupCache
succeeded, which corrupted the display and causedupdatingCache
to betrue
forever, which suppressed all further calls to update the setting while you typed the rest of the path.Later, when we tried to use the cache during an install,
NetModuleCache.GetSizeInfo
again threw its exception and broke everything.Changes
GetDrive()
directly compares the given path to the drive'sRootDirectory
in the hopes of avoiding NREs for paths likeE:
TrySetupCache
tries to check the free space associated with a cache path before changing the setting to it, to ensure it only ends up with valid values, which should make it fail forE:
downloading
folder until you actually use a cache folder (previously if you typed a long path, we'd try creating it at each level because it was inNetModuleCache
's constructor)Fixes #3801.
@navuek, there should be a test build that you can try here in a few minutes on the Checks tab under the Artifacts dropdown.