mirror of
https://github.com/Comfy-Org/comfy-swift-sdk.git
synced 2026-11-04 23:47:26 +00:00
[PR #6] [CLOSED] feat(logging): add credential-free os.Logger error logging at SDK catch sites #11
Labels
No labels
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-swift-sdk#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-swift-sdk/pull/6
Author: @mattmillerai
Created: 6/19/2026
Status: ❌ Closed
Base:
main← Head:matt/be-1608-comfyswiftsdk-add-minimal-error-logging-at-the📝 Commits (5)
39c1eaefix(transport): treat POSIX socket-drop errors as transient so jobs recover via pollingd94aaebfix(transport): retry transient errors on the execution_success output fetchea35614merge: main into BE-1606 branch to drop redundant BE-1594 base (it squash-merged)d765c2afeat(logging): add credential-free os.Logger error logging at SDK catch sites99caf98Merge main: resolve WebSocketSession output-build catch (keep logging atop #3's retry-exhausted surface)📊 Changes
5 files changed (+521 additions, -15 deletions)
View changed files
📝
Sources/ComfySwiftSDK/Internal/PollingFallback.swift(+12 -4)➕
Sources/ComfySwiftSDK/Internal/SDKLog.swift(+214 -0)📝
Sources/ComfySwiftSDK/Internal/Transport.swift(+14 -8)📝
Sources/ComfySwiftSDK/Internal/WebSocketSession.swift(+11 -3)➕
Tests/ComfySwiftSDKTests/LoggingPrivacyTests.swift(+270 -0)📄 Description
ELI5
The SDK logged nothing, so when something failed on-device the app only saw the final error with no clue which internal step threw it or why. This adds error-level Console logs at the SDK's failure points — strictly error classification (the
ComfyErrorcase, the POSIX code, thejobId), never the API key or token — so the next "background → connection error" repro is self-diagnosing instead of a guess.What
Internal/SDKLog.swift: a minimalos.Loggerfacade (no third-party dependency), subsystemorg.comfy.ComfySwiftSDK, categoriestransport/websocket/polling, with a test-only injectable sink for the privacy test..errorlogs at theTransport.translate,WebSocketSession(output-build / execution_error / read-loop transient-vs-.faileddecision), andPollingFallback(give-up / output-assembly / empty-output-exhausted) sites.Why
First scoped step of the deferred SDK observability — traceability, not full observability. Companion to the background-recovery fixes, so the next on-device failure records the exact catch + POSIX code.
Credential-free (the hard constraint)
Logs only the
ComfyErrorcase name, POSIX code, HTTP status, andjobId. Never the token / API key /Authorization/X-API-Keyvalue / request body / response body / rawErrororURLRequest.privacy: .publicis applied only to pre-assembled safe fields. The prior NFR-S2 "no logging" guard is re-aimed to "credential-free logging," and a newLoggingPrivacyTestssuite drives the failure paths under a captured-log sink and asserts a sentinel key + bearer token never appear (including a poisoned-userInfocase where the sentinel is buried in anNSErrordescription).Testing
swift buildclean;swift test132 tests, 0 failures (4 live-network skips unchanged). Scope held: error-level only, no remote sink, no new dependency.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.