• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nats-io / nats.go / 23545171746 / 1
86%
main: 86%

Build:
DEFAULT BRANCH: main
Ran 25 Mar 2026 02:10PM UTC
Files 37
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Mar 2026 02:05PM UTC coverage: 85.418% (+0.03%) from 85.392%
23545171746.1

push

github

web-flow
[FIXED] WebSocket close frame discarding buffered data frames (#2032)

When a NATS server rejects a WebSocket connection (e.g., due to an
expired JWT), it sends a -ERR protocol message followed by a WebSocket
close frame. If both frames arrive in the same TCP read, the
websocketReader.Read() method would process the close frame and
immediately return io.EOF, discarding the -ERR data that had already
been buffered in the pending list.

This caused nats.Connect to return a generic EOF error instead of the
proper authentication error (ErrAuthorization, ErrAuthExpired, etc.),
making it difficult for users to diagnose connection failures.

The fix defers the close frame's io.EOF when there is already pending
data, storing it in a new closeErr field. The pending data is returned
first, and the deferred error is returned on the subsequent Read() call.

Signed-off-by: Waldemar Quevedo <wally@nats.io>

14568 of 17055 relevant lines covered (85.42%)

32472.97 hits per line

Source Files on job 23545171746.1
  • Tree
  • List 37
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 23545171746
  • 03c61d71 on github
  • Prev Job for on main (#23543932958.1)
  • Next Job for on main (#23549883071.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc