Skip to content

Conversation

@jzaefferer
Copy link
Contributor

Here the proxy stream is being written, so we need to check if it is writable ("which means the stream has not been destroyed, errored, or ended, see https://nodejs.org/dist/v18.19.0/docs/api/stream.html#writablewritable ).

Fixes #1914

I could reproduce the 'stream.push() after EOF' error in an app, but unfortunately have no idea how to use it for a reproduction. Hopefully this patch provides enough inspiration to write a test.

Here the proxy stream is being written, so we need to check if it is writable ("which means the stream has not been destroyed, errored, or ended, see https://nodejs.org/dist/v18.19.0/docs/api/stream.html#writablewritable ).

Fixes mqttjs#1914
@robertsLando robertsLando enabled auto-merge (squash) September 4, 2025 16:11
@robertsLando
Copy link
Member

Thanks @jzaefferer nice catch!

@codecov
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.34%. Comparing base (a6e74ad) to head (7a8d81e).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/lib/connect/ws.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2024   +/-   ##
=======================================
  Coverage   83.34%   83.34%           
=======================================
  Files          25       25           
  Lines        1585     1585           
  Branches      367      367           
=======================================
  Hits         1321     1321           
  Misses        230      230           
  Partials       34       34           
Flag Coverage Δ
unittests 83.34% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robertsLando robertsLando merged commit fe45405 into mqttjs:main Sep 4, 2025
6 of 7 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.

[Bug]: JavascriptException: Error: stream.push() after EOF, js engine: hermes

2 participants