Skip to content

Conversation

@jog1t
Copy link
Collaborator

@jog1t jog1t commented Jan 13, 2026

TL;DR

Added duplex: 'half' to the fetch request options and explicitly cast to RequestInit type in the dev server middleware.

What changed?

Modified the fetch request configuration in createMiddleware function by:

  1. Adding the duplex: 'half' option to the request configuration
  2. Adding an explicit type cast to RequestInit to ensure TypeScript compatibility

How to test?

  1. Start the development server
  2. Verify that API requests from the client to the server work correctly
  3. Check that streaming responses (if applicable) function as expected

Why make this change?

This change addresses a potential issue with the Fetch API when handling certain types of requests. The duplex: 'half' option specifies that the request is a "half-duplex" connection, which is necessary for some request types to work correctly with newer Fetch API implementations. The explicit type cast ensures TypeScript doesn't raise errors about the additional property.

@jog1t jog1t marked this pull request as ready for review January 13, 2026 01:07
Copy link
Collaborator Author

jog1t commented Jan 13, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jog1t jog1t mentioned this pull request Jan 13, 2026
Copy link
Collaborator Author

jog1t commented Jan 13, 2026

Merge activity

  • Jan 13, 1:07 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jan 13, 1:08 AM UTC: Graphite rebased this pull request as part of a merge.
  • Jan 13, 1:09 AM UTC: @jog1t merged this pull request with Graphite.

@jog1t jog1t changed the base branch from 01-13-chore_update_the_docs to graphite-base/3 January 13, 2026 01:07
@jog1t jog1t changed the base branch from graphite-base/3 to main January 13, 2026 01:07
@jog1t jog1t force-pushed the 01-13-fix_use_duplex branch from 193ae91 to c26b4c8 Compare January 13, 2026 01:08
@jog1t jog1t merged commit 0c31717 into main Jan 13, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants