Repository navigation
v3.3.0: CDUntappdKitTesting Product + HTTP Error Headers - #42
Merged
chrisdhaan merged 4 commits intoAug 19, 2026
Merged
Conversation
Adds a public CDUntappdKitTesting SPM product exposing CDUntappdMockURLProtocol, so downstream consumers can mock CDUntappdKit-backed network calls in their own test suites (closes #39). CDUntappdAPIClient's urlSession:-accepting initializer is now public to pair with it. Adds CDUntappdKitError.httpErrorWithHeaders(statusCode:data:headers:), carrying the failed response's HTTP headers (e.g. Retry-After, rate-limit headers) alongside the status code and body. The prior httpError(statusCode:data:) case is deprecated and no longer thrown (closes #40). Claude-Session: https://claude.ai/code/session_01HdhEtXezNpB31vv93S5D4b Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
CDUntappdMockURLProtocol.canInit/canonicalRequest override URLProtocol's `class func` as `override class func`, but SwiftLint's CI-only `Source`-scoped lint pass never caught this while the file lived under Tests/. Now that it's public API under Source/Testing/, switch to `override static func`, valid since the class is final. Claude-Session: https://claude.ai/code/session_01HdhEtXezNpB31vv93S5D4b Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
CDUntappdEventMonitor.requestDidComplete(...) and CDUntappdURLSession's notifyComplete(...) wrote error: Error? instead of error: (any Error)?, pre-existing warnings under the ExistentialAny upcoming feature this package enables, unrelated to this PR's changes but flagged in the same CI run. CDUntappdMockURLProtocol.Stub.error was (any Error)?, non-Sendable, which warned on the DispatchQueue.asyncAfter closure that captures a Stub. Constrained it to (any Error & Sendable)? (matching CDUntappdKitError's own any Error & Sendable convention) and made Stub itself Sendable — this surfaced now that the file lives in Source/ rather than Tests/. Claude-Session: https://claude.ai/code/session_01HdhEtXezNpB31vv93S5D4b Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Package.swift's platform minimums (iOS 15 / macOS 12 / tvOS 15 / watchOS 8 / visionOS 1) already exceed every one of these gates: the async/await @available(macOS 10.15, iOS 13.0, ...) marker on every async method, the Logger @available(iOS 14.0, macOS 11.0, ...) gate at file scope, and the matching `if #available(iOS 14.0, ...)` runtime checks wrapping every logger.error(...) call. All of them were always-true given the current floor, so they're deleted rather than satisfied by a higher SDK - no SDK bump changes anything here. Also drops the iOS 13 UIWindowScene availability check and its dead pre-scene `keyWindow` fallback in UIApplication.topViewController(_:), for the same reason. Claude-Session: https://claude.ai/code/session_01HdhEtXezNpB31vv93S5D4b Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
chrisdhaan
deleted the
feature/39-40-testing-product-and-http-error-headers
branch
August 19, 2026 21:13
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.
Summary
CDUntappdKitTestingSPM product exposingCDUntappdMockURLProtocol(moved fromTests/toSource/Testing/), so downstream consumers can mock CDUntappdKit-backed network calls in their own test suites without reimplementing aURLProtocolstub.CDUntappdAPIClient'surlSession:-accepting initializer is now public to pair with it. Closes Promote request mocking to a public CDUntappdKitTesting product #39.CDUntappdKitError.httpErrorWithHeaders(statusCode:data:headers:), carrying the failed response's HTTP headers (e.g.Retry-After, rate-limit headers) alongside the status code and body. The priorhttpError(statusCode:data:)case is deprecated and no longer thrown by the library — kept only for source compatibility with existing exhaustive pattern matches. Closes CDUntappdKitError.httpError discards response headers #40.Test plan
swift test— 279 tests pass, including a newCDUntappdKitTestingProductTests.swiftthat exercises the full public product end-to-end (no@testable) exactly as a downstream consumer wouldswiftformat Source Tests --lint— cleanxcodebuild -project CDUntappdKit.xcodeproj -scheme "CDUntappdKit iOS" build— confirmsSource/Testingstays excluded from the main framework target and SwiftLint passesswift package generate-documentation --target CDUntappdKit— DocC build clean, no warningsClaude-Session: https://claude.ai/code/session_01HdhEtXezNpB31vv93S5D4b