[PR #24] [MERGED] refactor(transport): remove dead WebSocket frame DTOs and unused typealias #27

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

📋 Pull Request Information

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

Base: main ← Head: chore/remove-dead-ws-frame-dtos


📝 Commits (1)

  • 160865f refactor(transport): remove dead WebSocket frame DTOs and unused typealias

📊 Changes

1 file changed (+0 additions, -34 deletions)

View changed files

📝 Sources/ComfySwiftSDK/Internal/DTOs/JobStatusDTO.swift (+0 -34)

📄 Description

ELI-5

There were four pieces of "dead" code in the WebSocket message file: three little
data-shape structs and one nickname (typealias) that nothing in the project ever
used. This PR deletes them. Nothing changes at runtime — it just removes clutter.

What

Removes declaration-only code from Internal/DTOs/JobStatusDTO.swift:

  • struct ProgressFrameData
  • struct ExecutingFrameData
  • struct ExecutionSuccessFrameData
  • typealias JobStatusDTO = JobDetailResponse

Why

All four were verified unused via grep across Sources + Tests — each appeared
only at its own declaration. The read loop parses executing/progress frames by
hand (envelope.data?.value as? [String: Any], manual Int→Double coercion), so
these typed structs were never wired in; ExecutionSuccessFrameData and the
JobStatusDTO alias likewise had no consumers.

Scope notes / judgment calls

  • Kept the live frame DTOs: ExecutedFrameData and ExecutionErrorFrameData
    are decoded and used in WebSocketSession.swift (lines 236 and 308) — untouched.
  • Left NodeOutputPayload.audio in place. It is decoded-but-never-read dead
    plumbing, but removing it also removes latent intent to support audio outputs —
    deliberately left for maintainers.
  • Did not attempt the decode-path unification (converging the hand-rolled
    executing/progress parsing onto typed structs). That is a real but optional
    medium-risk refactor that must preserve the tolerant "skip unknown/garbled frames"
    behavior; out of scope for this zero-risk cleanup.

Testing

  • swift build — clean.
  • swift test --no-parallel — 150 tests in 20 suites passed, including the
    WebSocket frame tests.

Pure deletion of dead declarations; no behavior change.


🔄 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/24 **Author:** [@mattmillerai](https://github.com/mattmillerai) **Created:** 7/4/2026 **Status:** ✅ Merged **Merged:** 7/5/2026 **Merged by:** [@mattmillerai](https://github.com/mattmillerai) **Base:** `main` ← **Head:** `chore/remove-dead-ws-frame-dtos` --- ### 📝 Commits (1) - [`160865f`](https://github.com/Comfy-Org/comfy-swift-sdk/commit/160865f147e33c0cf76fcc4f58365d35e960fa04) refactor(transport): remove dead WebSocket frame DTOs and unused typealias ### 📊 Changes **1 file changed** (+0 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `Sources/ComfySwiftSDK/Internal/DTOs/JobStatusDTO.swift` (+0 -34) </details> ### 📄 Description ## ELI-5 There were four pieces of "dead" code in the WebSocket message file: three little data-shape structs and one nickname (typealias) that nothing in the project ever used. This PR deletes them. Nothing changes at runtime — it just removes clutter. ## What Removes declaration-only code from `Internal/DTOs/JobStatusDTO.swift`: - `struct ProgressFrameData` - `struct ExecutingFrameData` - `struct ExecutionSuccessFrameData` - `typealias JobStatusDTO = JobDetailResponse` ## Why All four were verified unused via grep across `Sources` + `Tests` — each appeared only at its own declaration. The read loop parses `executing`/`progress` frames by hand (`envelope.data?.value as? [String: Any]`, manual `Int`→`Double` coercion), so these typed structs were never wired in; `ExecutionSuccessFrameData` and the `JobStatusDTO` alias likewise had no consumers. ## Scope notes / judgment calls - **Kept the live frame DTOs:** `ExecutedFrameData` and `ExecutionErrorFrameData` are decoded and used in `WebSocketSession.swift` (lines 236 and 308) — untouched. - **Left `NodeOutputPayload.audio` in place.** It is decoded-but-never-read dead plumbing, but removing it also removes latent intent to support audio outputs — deliberately left for maintainers. - **Did not attempt the decode-path unification** (converging the hand-rolled `executing`/`progress` parsing onto typed structs). That is a real but optional medium-risk refactor that must preserve the tolerant "skip unknown/garbled frames" behavior; out of scope for this zero-risk cleanup. ## Testing - `swift build` — clean. - `swift test --no-parallel` — **150 tests in 20 suites passed**, including the WebSocket frame tests. Pure deletion of dead declarations; no behavior change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 22:34:07 +00:00
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#27
No description provided.