internal/download: improve era file status messages #31933
Closed
+183
−3
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.
Summary
This PR improves the status messages displayed during era file downloads to provide clearer feedback to users about the file state.
Problem
Previously, all era files would show the generic message "is stale" regardless of whether the file was missing or had a hash mismatch. This caused confusion for users who couldn't distinguish between different file states.
Solution
Modified the
DownloadFile
function ininternal/download/download.go
to:"not found, downloading..."
"is stale (hash mismatch)"
"is up-to-date"
(unchanged)Changes
Modified
internal/download/download.go
:DownloadFile
functionos.IsNotExist
and hash mismatch errorsAdded
internal/download/download_test.go
:Testing
go test ./internal/download -v
All tests pass, covering:
Fixes
Closes #31917