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

nats-io / nats-server / 44460059497
76%

Build:
DEFAULT BRANCH: main
Ran 19 Nov 2026 05:48AM UTC
Jobs 1
Files 66
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

18 Nov 2026 02:01PM UTC coverage: 76.88% (-0.02%) from 76.895%
44460059497

push

github

web-flow
(2.16) [FIXED] Send async INFO to clients when max_payload limit changes (#8833)

Fixes #8814 

### Description

Currently, when an account JWT update modifies `limits.payload` or a
config reload changes the server's `max_payload`, existing client
connections do not receive an updated async INFO protocol message.

Because client libraries (like `nats.go`) validate message sizes against
the cached `max_payload` received during the initial connect handshake:
- If the limit is raised, existing clients continue rejecting valid
payloads locally (`ErrMaxPayload`) until they reconnect.
- If the limit is lowered, clients attempt to publish messages that the
server now rejects with `-ERR 'Maximum Payload Violation'`, causing the
connection to be closed.
- Additionally, on config reload, `maxPayloadOption.Apply` was directly
overwriting `client.mpay`, which accidentally stripped out stricter
account-level and user-level JWT limits.

### Changes

1. **`server/accounts.go`**: In `updateAccountClaimsWithRefresh`, check
if the effective `c.mpay` changed after calling
`c.applyAccountLimits()`. If changed, send an updated async INFO message
to eligible clients (`protocol >= 1` and initial handshake complete).
2. **`server/client.go`**: Added helper `c.sendAsyncInfo(info)` that
generates the client-specific INFO JSON with the updated `c.mpay` and
queues it.
3. **`server/reload.go`**: In `maxPayloadOption.Apply`, removed the
blind `client.mpay` overwrite. Limits are now re-evaluated using
`client.applyAccountLimits()` to preserve account/user JWT precedence,
and clients are notified if their effective limit changed.
4. **`server/jwt_test.go`**: Added regression tests covering limit
increases, decreases, user JWT limit precedence, protocol 0 clients, and
config reloads.

69107 of 89890 relevant lines covered (76.88%)

307821.16 hits per line

Coverage Regressions

Lines Coverage ∆ File
743
86.07
-0.07% src/github.com/nats-io/nats-server/server/stream.go
427
55.38
0.68% src/github.com/nats-io/nats-server/server/reload.go
276
89.75
0.08% src/github.com/nats-io/nats-server/server/client.go
265
84.49
0.0% src/github.com/nats-io/nats-server/server/jetstream.go
148
83.49
-0.17% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
119
86.02
0.04% src/github.com/nats-io/nats-server/server/accounts.go
55
79.35
-0.46% src/github.com/nats-io/nats-server/server/filestore.go
33
74.91
-0.35% src/github.com/nats-io/nats-server/server/raft.go
26
92.27
0.43% src/github.com/nats-io/nats-server/server/jetstream_batching.go
8
62.31
-0.07% src/github.com/nats-io/nats-server/server/opts.go
7
73.34
-0.05% src/github.com/nats-io/nats-server/server/jetstream_api.go
5
82.37
-0.67% src/github.com/nats-io/nats-server/server/parser.go
3
84.02
0.0% src/github.com/nats-io/nats-server/server/events.go
3
72.89
-0.14% src/github.com/nats-io/nats-server/server/memstore.go
2
64.23
-0.36% src/github.com/nats-io/nats-server/server/dirstore.go
2
94.07
0.19% src/github.com/nats-io/nats-server/server/gateway.go
2
56.6
-1.26% src/github.com/nats-io/nats-server/server/log.go
2
86.7
0.0% src/github.com/nats-io/nats-server/server/server.go
1
88.01
0.11% src/github.com/nats-io/nats-server/server/consumer.go
Jobs
ID Job ID Ran Files Coverage
1 44460059497.1 19 Nov 2026 05:48AM UTC 66
76.88
GitHub Action Run
Source Files on build 44460059497
  • Tree
  • List 66
  • Changed 26
  • Source Changed 8
  • Coverage Changed 25
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #44460059497
  • ba5c7e53 on github
  • Prev Build on main (#44239074582)
  • Next Build on main (#44676099935)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc