Report storage quota errors when save usage cannot be read #123

Manually merged
github merged 1 commit from github-bot/gh-123 into main 2026-11-26 08:21:46 +00:00 AGit
Owner

@⁠feanorsun on GitHub · 2026-11-26 05:09 UTC · original
feanorsun:fix/storage-quota-read-errors → main · +104 −27 · 1 files · 1 commits · merged 2026-11-26 08:17 UTC

Refs #30

XSystem previously treated an unreadable storage root as empty and ignored errors while enumerating entries or reading their metadata. A title could therefore receive the full quota in response to a space request even when the runtime could not measure its usage.

The usage walk now propagates the first error, including failures in nested directories. The quota query logs the path and OS error once per failed scan and returns E_FAIL without writing partial space information. A valid async prompt still starts with S_OK. Its final status and result both report E_FAIL when scanning fails, or E_ABORT when a successful scan shows insufficient quota.

First launch creates the storage directory before installing the title. An empty directory still uses zero bytes, and a successful query uses the same quota and host free-space calculations. This addresses item 1. Usage caching (item 2) is left for follow-up.

Windows tests

With the regression assertion added to the original implementation, this exact test failed on a 1,000-byte request against a regular file used as the storage root. The final status and result were both S_OK. The same assertion passes with the change and observes E_FAIL for both.

$regression = 'modules::storage::tests::serves_a_drive_over_the_title_folder_and_its_quota'
cargo test --locked -j 1 -p victory-hle --lib $regression -- --test-threads=1 --exact --list
cargo test --locked -j 1 -p victory-hle --lib $regression -- --test-threads=1 --exact --nocapture

cargo test --locked -j 1 -p victory-hle --lib modules::storage::tests:: -- --test-threads=1 --list
cargo test --locked -j 1 -p victory-hle --lib modules::storage::tests:: -- --test-threads=1 --nocapture

The fixed Windows build listed and ran 5 targeted CPU tests. All 5 passed, with 151 unrelated tests filtered out. The fixtures covered an empty directory, 8 bytes across nested files, a missing root, an exclusively opened subdirectory, and the synchronous and asynchronous quota interfaces. Local verification used temporary storage only. No game, GPU, D3D12, or WARP tests were run.

**@⁠feanorsun** on GitHub · 2026-11-26 05:09 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/123) `feanorsun:fix/storage-quota-read-errors` → `main` · +104 −27 · 1 files · 1 commits · merged 2026-11-26 08:17 UTC Refs #30 XSystem previously treated an unreadable storage root as empty and ignored errors while enumerating entries or reading their metadata. A title could therefore receive the full quota in response to a space request even when the runtime could not measure its usage. The usage walk now propagates the first error, including failures in nested directories. The quota query logs the path and OS error once per failed scan and returns `E_FAIL` without writing partial space information. A valid async prompt still starts with `S_OK`. Its final status and result both report `E_FAIL` when scanning fails, or `E_ABORT` when a successful scan shows insufficient quota. First launch creates the storage directory before installing the title. An empty directory still uses zero bytes, and a successful query uses the same quota and host free-space calculations. This addresses item 1. Usage caching (item 2) is left for follow-up. ## Windows tests With the regression assertion added to the original implementation, this exact test failed on a 1,000-byte request against a regular file used as the storage root. The final status and result were both `S_OK`. The same assertion passes with the change and observes `E_FAIL` for both. ```powershell $regression = 'modules::storage::tests::serves_a_drive_over_the_title_folder_and_its_quota' cargo test --locked -j 1 -p victory-hle --lib $regression -- --test-threads=1 --exact --list cargo test --locked -j 1 -p victory-hle --lib $regression -- --test-threads=1 --exact --nocapture cargo test --locked -j 1 -p victory-hle --lib modules::storage::tests:: -- --test-threads=1 --list cargo test --locked -j 1 -p victory-hle --lib modules::storage::tests:: -- --test-threads=1 --nocapture ``` The fixed Windows build listed and ran 5 targeted CPU tests. All 5 passed, with 151 unrelated tests filtered out. The fixtures covered an empty directory, 8 bytes across nested files, a missing root, an exclusively opened subdirectory, and the synchronous and asynchronous quota interfaces. Local verification used temporary storage only. No game, GPU, D3D12, or WARP tests were run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:24:54 +00:00
Author
Owner

@⁠avatarmanz on GitHub · 2026-11-26 07:55 UTC · original

Merged into main in the next push (tests pass); thanks.

**@⁠avatarmanz** on GitHub · 2026-11-26 07:55 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/123#issuecomment-7185986941) Merged into main in the next push (tests pass); thanks.
github manually merged commit 450b61248e into main 2026-11-26 08:21:46 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.