mirror of
https://github.com/Comfy-Org/comfy-swift-sdk.git
synced 2026-11-04 23:47:26 +00:00
[PR #5] [MERGED] fix(reattach): retry transient catch-up GET failures instead of failing the stream #10
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#10
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/5
Author: @mattmillerai
Created: 6/19/2026
Status: ✅ Merged
Merged: 6/19/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-1606-reattach-catchup-transient-retry📝 Commits (1)
a7aeb9dfix(reattach): retry transient catch-up GET failures instead of failing the stream📊 Changes
2 files changed (+154 additions, -4 deletions)
View changed files
📝
Sources/ComfySwiftSDK/Internal/ReattachCoordinator.swift(+40 -4)➕
Tests/ComfySwiftSDKTests/ReattachTransientRetryTests.swift(+114 -0)📄 Description
What
When the app foregrounds after a longer background window,
ReattachCoordinator's catch-up GET (fetchJobStatus) is the first request on a socket the OS just resumed from suspension, and it frequently fails transiently. The previous code surfaced any catch-up failure as a terminal.failed, falsely killing a job that's usually still recoverable — and for a job that completed while backgrounded, often already done.Observed on device:
ComfyError.network(underlying: NSURLErrorDomain Code=-1011)(NSURLErrorBadServerResponse) during thereconnectingphase → terminal.failed. The error was already correctly classified as a transient.network; the reattach catch-up path just didn't treat it as retryable.Fix
Wrap the catch-up fetch in a small bounded retry (3 attempts) that retries only
PollingFallback.isTransienterrors (.network/.offline/.timeout). Non-transient failures — and the final-attempt transient — still propagate, so the stream terminates rather than looping forever.Tests
.complete.failed) unchangedswift build+swift testgreen (110 tests).Relationship to #3
#3 hardens the output download path. This PR hardens the reattach catch-up GET path — the one the on-device capture showed failing with -1011 during reconnect. Complementary; both can land.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.