mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #5] [MERGED] test + fix: SSE/core/translate coverage, and monotonic progress across reconnect #15
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
bug
cursor-review-pin
effort:medium
effort:small
effort:trivial
priority:nice-to-have
priority:recommended
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-typescript-sdk#15
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-typescript-sdk/pull/5
Author: @wei-hai
Created: 7/20/2026
Status: ✅ Merged
Merged: 7/20/2026
Merged by: @wei-hai
Base:
main← Head:test/comprehensive-qa📝 Commits (2)
b34757ftest: cover the SSE decoder, sans-IO core walk, translate, and poll backstop3442242fix: guarantee monotonic progress across an SSE reconnect📊 Changes
6 files changed (+219 additions, -2 deletions)
View changed files
➕
src/low/sse.test.ts(+64 -0)➕
src/sdk/core.test.ts(+90 -0)📝
src/sdk/exceptions.test.ts(+20 -0)📝
src/sdk/jobs.test.ts(+28 -0)📝
src/sdk/jobs.ts(+9 -0)📝
test/support/stub-server.ts(+8 -2)📄 Description
Adds 16 tests for logic the existing suite only exercised incidentally. Two source files with real logic (
src/low/sse.ts,src/sdk/core.ts) had no dedicated test file and were only reached throughjobs/assetstests, leaving their edge branches dark.What's added
src/low/sse.test.ts(new) —iterateSseframe parsing: multi-linedata:joined with newlines, comment/keepalive lines skipped, a data-less frame dropped, a frame reassembled across chunk boundaries (including a split mid-UTF-8 character), and the non-object / non-JSON payload fallbacks ({value}/{raw}).src/sdk/core.test.ts(new) —findAssetHandles/substituteAssetHandleswalking arrays and nested objects (batch inputs), the "handle not materialized" throw, plusassetReferencefield selection,isTerminal(cancelingis deliberately not terminal), andbackoffSchedulegrowth/cap.src/sdk/exceptions.test.ts—translate()re-raises anApiErroras its idiomatic SDK exception and passes a non-ApiError(e.g. a networkTypeError) through by identity, never wrapping it.src/sdk/jobs.test.ts—events()settles from the poll backstop with no second SSE connection when a mid-stream drop leaves the job already terminal (the largest previously-uncovered block).Coverage: 90.8% → 92.9% statements, 81.9% → 84.7% branches (
sse.ts73→91,core.ts80→98,jobs.ts86→91). Full suite 104 passed; tsc, lint, format, spec-drift all clean.Fixed in this PR
Job.events()now suppresses aprogressframe whose value regresses below the highest already emitted, so a consumer'''s progress never goes backwards; the guard persists across reconnects. Regression-tested.Still flagged (needs a spec change, not fixable in the SDK)
202scan-pending. The SDK can'''t poll to readiness because the contract has no observable signal:getAssetdocuments only200(no202) and theAssetschema has no scan/ready field. Defining that readiness signal is a cloud-spec change first.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.