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

feat(misskey-js): allow setting binaryType of WebSocket connection #15190

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

cannorin
Copy link

@cannorin cannorin commented Dec 29, 2024

What

This PR allows developers who use misskey-js to customize binaryType of the underlying WebSocket connection when using the streaming API.

Why

I wanted to use this library on bun to create a bot application with streaming capability.

However, bun does not support WebSocket connections with binaryType set to blob (probably just yet), which happens to be the default value.

See: oven-sh/bun#8721

Additional info (optional)

I'm not very sure if testing this over a mocked WebSocket server (new WS('wss://misskey.test/streaming')) would be helpful, as what really matters here is whether the real Misskey servers accept WebSocket connections of arraybuffer binary type.

As far as I can test, it is working without any issues when connecting to my own Misskey instance.

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

Copy link

codecov bot commented Dec 29, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 41.90%. Comparing base (13439e0) to head (d3f097f).

Files with missing lines Patch % Lines
packages/misskey-js/src/streaming.ts 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #15190      +/-   ##
===========================================
+ Coverage    40.31%   41.90%   +1.58%     
===========================================
  Files         1564     1568       +4     
  Lines       198083   203868    +5785     
  Branches      3837     3875      +38     
===========================================
+ Hits         79863    85427    +5564     
- Misses      117617   117836     +219     
- Partials       603      605       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cannorin cannorin force-pushed the misskey-js/stream-binary-type branch 2 times, most recently from 61fa943 to eaef109 Compare December 29, 2024 09:51
@cannorin cannorin force-pushed the misskey-js/stream-binary-type branch from eaef109 to d3f097f Compare January 10, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

1 participant