Preserve HTTP response and transport error details - #27
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Preserves HTTP response metadata and underlying transport diagnostics while maintaining security checks and TUF fallback behavior.
Changes:
- Adds structured HTTP and network error details.
- Retains status, headers, URLs, and timeout diagnostics safely.
- Updates TUF fallback handling and regression coverage.
| File | Description |
|---|---|
Tests/AppUpdaterTests/TUFTests.swift |
Tests embedded fallback for HTTP failures. |
Tests/AppUpdaterTests/AppUpdaterTests.swift |
Tests HTTP, timeout, security, and download behavior. |
Attestation/TUF.swift |
Treats HTTP failures as network failures for fallback. |
AppUpdater.swift |
Adds HTTP and network failure details. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage Report for CI Build 36139576316Coverage increased (+0.4%) to 70.865%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
HTTP failures during update checks currently become
invalidHTTPResponse, so a GitHub rate limit or HTTP 500 is presented as “an invalid or insecure response” and callers cannot inspect the status or retry headers. Transport errors also lose their original diagnostic context.Add
AppUpdaterHTTPErrorretaining the fullHTTPURLResponse, with localized status details and messages for HTTP 429 or HTTP 403 with an exhausted rate-limit header. Retain the originalURLErrorinAppUpdaterNetworkError.underlyingError, including network timeouts. Alert text includes the host, never signed URL paths/query strings or response bodies; callers inspecting the retained objects must treat them as potentially sensitive.HTTPS, redirect, content-type, compression, size, and installation checks remain enforced. TUF recognizes the new HTTP error as a network failure, preserving its existing verified-cache/embedded fallback behavior. Cancellation still propagates unchanged.
Compatibility: non-2xx HTTPS responses now throw
AppUpdaterHTTPErrorinstead of.invalidHTTPResponse; network timeouts now throwAppUpdaterNetworkErrorwith.timedOutinstead of.operationTimedOut. Process timeouts are unchanged.Validation:
swift testpassed all 80 tests, then the added download-failure regression passed separately. Coverage includes preserved status/headers/URL, 403 vs confirmed rate limiting, 429/503, safe alert text, original transport diagnostics, timeout diagnostics, TUF fallback, and no promoted download on HTTP failure.