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

nats-io / nats.go / 23545171746
85%

Build:
DEFAULT BRANCH: main
Ran 25 Mar 2026 02:10PM UTC
Jobs 1
Files 37
Run time 1min
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

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>

11 of 11 new or added lines in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

14568 of 17055 relevant lines covered (85.42%)

32472.97 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
2
89.47
-0.05% nats.go
Jobs
ID Job ID Ran Files Coverage
1 23545171746.1 25 Mar 2026 02:10PM UTC 37
85.42
GitHub Action Run
Source Files on build 23545171746
  • Tree
  • List 37
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23545171746
  • 03c61d71 on github
  • Prev Build on main (#23543932958)
  • Next Build on main (#23549883071)
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