Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve Node.js client streaming implementation #182

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

vikhyat
Copy link
Owner

@vikhyat vikhyat commented Jan 2, 2025

This PR fixes the skipped unit tests in the Node.js client and improves the streaming implementation.

Changes:

  • Fix streaming implementation to properly handle Node.js streams
  • Add proper TypeScript types for async iterator
  • Fix tests to properly mock streaming response
  • Make code more robust by handling both completion and end events
  • Remove unnecessary buffering of chunks
  • Add proper cleanup of event listeners

The key improvements are:

  1. Real streaming - chunks are yielded as they arrive, not buffered
  2. Better error handling - errors are properly propagated
  3. Proper cleanup - event listeners are removed when done
  4. Type safety - proper TypeScript types for all interfaces

All tests are now passing, including both unit tests and integration tests.

- Fix streaming implementation to properly handle Node.js streams
- Add proper TypeScript types for async iterator
- Fix tests to properly mock streaming response
- Make code more robust by handling both completion and end events
- Remove unnecessary buffering of chunks
- Add proper cleanup of event listeners
@vikhyat vikhyat merged commit 35995b7 into main Jan 2, 2025
3 checks passed
@vikhyat vikhyat deleted the fix-node-streaming-tests branch January 2, 2025 23:54
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