mirror of
https://github.com/Comfy-Org/comfy-swift-sdk.git
synced 2026-11-04 23:47:26 +00:00
[PR #17] [MERGED] feat(cancel): migrate job cancel onto POST /api/jobs/{job_id}/cancel #19
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#19
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/17
Author: @mattmillerai
Created: 6/21/2026
Status: ✅ Merged
Merged: 6/21/2026
Merged by: @mattmillerai
Base:
main← Head:feat/cancel-jobs-api-migration📝 Commits (2)
ab7274dfeat(cancel): migrate job cancel onto POST /api/jobs/{job_id}/cancele5d4e19test(cancel): add live cancel round-trip smoke test (verified against staging)📊 Changes
4 files changed (+88 additions, -23 deletions)
View changed files
📝
Scripts/contract/sdk-endpoints.yml(+2 -5)📝
Sources/ComfySwiftSDK/Internal/Transport.swift(+1 -6)➕
Tests/ComfySwiftSDKTests/JobCancelEndpointTests.swift(+44 -0)📝
Tests/ComfySwiftSDKTests/SmokeIntegrationTests.swift(+41 -12)📄 Description
Closes #12 — the last endpoint the contract drift check still flagged.
Migrates
Transport.cancelJoboff the deprecatedPOST /api/queue {"delete":[id]}ontoPOST /api/jobs/{job_id}/cancel. Both cancel callers (PollingFallback,WebSocketSession) route through this one method, so it's a single-site change.Changes
Transport.cancelJob→POST /api/jobs/{job_id}/cancel(prompt_id==job_id, soJobHandle.idis already the path param). No request body; cancel stays best-effort/fire-and-forget and still yields.cancelledregardless of the{ "cancelled": boolean }response.JobCancelEndpointTests— new coverage asserting the cancel posts to/api/jobs/{job_id}/cancel(the cancel path previously had no test).Scripts/contract/sdk-endpoints.yml— moved the entry onto/api/jobs/{job_id}/cancel.Verification
swift buildcleanswift test --no-parallel— 144 tests pass (+1)master: 6 ok, 0 warnings, 0 errors (was 1 warning)Why draft
The unit suite proves the SDK calls the right endpoint, but not that the real cancel round-trips on the backend. Gate before merge: a staging smoke test against
cloud.comfy.orgconfirming a real submit → cancel. Mark ready once that's green.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.