[PR #45] [MERGED] refactor: remove dead JobHandle.reconnectToken scaffolding #49

Closed
opened 2026-10-26 22:34:22 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/comfy-swift-sdk/pull/45
Author: @mattmillerai
Created: 7/11/2026
Status: ✅ Merged
Merged: 7/16/2026
Merged by: @mattmillerai

Base: main ← Head: matt/be-2863-remove-reconnecttoken


📝 Commits (1)

  • f94f346 refactor: remove dead JobHandle.reconnectToken scaffolding

📊 Changes

3 files changed (+3 additions, -6 deletions)

View changed files

📝 Sources/ComfySwiftSDK/Internal/Transport.swift (+1 -1)
📝 Sources/ComfySwiftSDK/Public/ComfyCloudClient.swift (+1 -1)
📝 Sources/ComfySwiftSDK/Public/JobHandle.swift (+1 -4)

📄 Description

ELI-5

JobHandle carried a reconnectToken field that was scaffolding for a reconnect feature that never got built. It was only ever set to nil and never read anywhere in the SDK, so it did nothing. This deletes it and the two reconnectToken: nil arguments that fed it — pure dead-code cleanup, no behavior change.

What changed

  • Public/JobHandle.swift: removed the internal let reconnectToken: String? field, the reconnectToken: init parameter, and its assignment. The init is now internal init(id: String) { self.id = id }.
  • Internal/Transport.swift: JobHandle(id: dto.promptId, reconnectToken: nil) → JobHandle(id: dto.promptId).
  • Public/ComfyCloudClient.swift: JobHandle(id: promptId, reconnectToken: nil) → JobHandle(id: promptId).

Why it's safe

  • A repo-wide grep confirms reconnectToken had zero reads — only the declaration and the two nil writes. Nothing consumed it.
  • Both the field and the init were internal; the public API surface (public let id) is unchanged, so this is not a public API break.
  • JobHandle's Hashable/Sendable conformances are compiler-synthesized. Because reconnectToken was nil at every construction site, equality/hashing over id alone is behaviorally identical to the old id + reconnectToken synthesis.
  • Existing reattach tests are unaffected — they construct JobHandle(id: "job-1") (no token arg), and the source-substring assertion for JobHandle(id: promptId still holds.

Testing

  • swift build — clean.
  • Full swift test — 226 tests in 28 suites pass.
  • grep -rn reconnectToken Sources Tests — returns nothing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/comfy-swift-sdk/pull/45 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 7/11/2026 **Status:** ✅ Merged **Merged:** 7/16/2026 **Merged by:** [@mattmillerai](https://github.com/mattmillerai) **Base:** `main` ← **Head:** `matt/be-2863-remove-reconnecttoken` --- ### 📝 Commits (1) - [`f94f346`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/f94f346a0609c2d96cfd1efbdbe21277a2877ec0) refactor: remove dead JobHandle.reconnectToken scaffolding ### 📊 Changes **3 files changed** (+3 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `Sources/ComfySwiftSDK/Internal/Transport.swift` (+1 -1) 📝 `Sources/ComfySwiftSDK/Public/ComfyCloudClient.swift` (+1 -1) 📝 `Sources/ComfySwiftSDK/Public/JobHandle.swift` (+1 -4) </details> ### 📄 Description ## ELI-5 `JobHandle` carried a `reconnectToken` field that was scaffolding for a reconnect feature that never got built. It was only ever set to `nil` and never read anywhere in the SDK, so it did nothing. This deletes it and the two `reconnectToken: nil` arguments that fed it — pure dead-code cleanup, no behavior change. ## What changed - `Public/JobHandle.swift`: removed the `internal let reconnectToken: String?` field, the `reconnectToken:` init parameter, and its assignment. The init is now `internal init(id: String) { self.id = id }`. - `Internal/Transport.swift`: `JobHandle(id: dto.promptId, reconnectToken: nil)` → `JobHandle(id: dto.promptId)`. - `Public/ComfyCloudClient.swift`: `JobHandle(id: promptId, reconnectToken: nil)` → `JobHandle(id: promptId)`. ## Why it's safe - A repo-wide grep confirms `reconnectToken` had **zero reads** — only the declaration and the two `nil` writes. Nothing consumed it. - Both the field and the init were `internal`; the public API surface (`public let id`) is unchanged, so this is not a public API break. - `JobHandle`'s `Hashable`/`Sendable` conformances are compiler-synthesized. Because `reconnectToken` was `nil` at every construction site, equality/hashing over `id` alone is behaviorally identical to the old `id` + `reconnectToken` synthesis. - Existing reattach tests are unaffected — they construct `JobHandle(id: "job-1")` (no token arg), and the source-substring assertion for `JobHandle(id: promptId` still holds. ## Testing - `swift build` — clean. - Full `swift test` — 226 tests in 28 suites pass. - `grep -rn reconnectToken Sources Tests` — returns nothing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/comfy-swift-sdk#49
No description provided.