fix: Uint8Array type error, update tests for flux-fast.schnell v2 - #27
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
WalkthroughUpdates job type strings to "inference.flux-fast.schnell.txt2img.v2", removes explicit width/height from job configs, adjusts tests (error expectations and test scaffolding), disables resource sanitization for some tests, and refactors Blob construction for Uint8Array input without changing public APIs. Changes
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
6f45c4c to
daee559
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/v2.errors.test.ts (1)
1-7: Remove the unusedProdiaCapacityErrorimport.
ProdiaCapacityErroris imported on line 5 but is never used in this test file.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/v2.errors.test.ts` around lines 1 - 7, The import list in the test currently includes an unused symbol ProdiaCapacityError; remove ProdiaCapacityError from the named imports in the top-level import (the line importing createProdia, ProdiaBadResponseError, ProdiaCapacityError, ProdiaUserError) so only used symbols remain (createProdia, ProdiaBadResponseError, ProdiaUserError), or alternatively reference ProdiaCapacityError in a test if it should be exercised—update the import to match actual usage.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@test/v2.errors.test.ts`:
- Around line 1-7: The import list in the test currently includes an unused
symbol ProdiaCapacityError; remove ProdiaCapacityError from the named imports in
the top-level import (the line importing createProdia, ProdiaBadResponseError,
ProdiaCapacityError, ProdiaUserError) so only used symbols remain (createProdia,
ProdiaBadResponseError, ProdiaUserError), or alternatively reference
ProdiaCapacityError in a test if it should be exercised—update the import to
match actual usage.
- Cast Uint8Array to BlobPart to fix TS2322 with TypeScript 5.x - Update tests and example from deprecated flux.schnell v1 to flux-fast.schnell v2 - Remove width/height config (not supported by flux-fast) - Update no-type error test to expect ProdiaBadResponseError - Add sanitizeResources: false to example tests to prevent flaky Deno resource leak detection on fetch responses Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
daee559 to
344c677
Compare
Summary
TS2322type error when passingUint8ArraytoBlobconstructor in TypeScript 5.x (cast toBlobPart)inference.flux.schnell.txt2img.v1toinference.flux-fast.schnell.txt2img.v2width/heightfrom test configs (not supported by flux-fast)ProdiaBadResponseError(API behavior change)Test plan
deno check v2/index.tspassesdeno fmt --checkpassesdeno testpasses (all 6 tests)node example.mjspasses on Node 18, 20, 22🤖 Generated with Claude Code