# features

name: parseMsgSchedule
go_file: server/scheduler.go
go_method: parseMsgSchedule
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: Scheduler
dotnet_method: ParseMsgSchedule
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:00:54
description:
parseMsgSchedule parses a message schedule pattern and returns the time
to fire, whether it is a repeating schedule, and whether the pattern was valid.


name: isSubjectDeleteMarker
go_file: server/sdm.go
go_method: isSubjectDeleteMarker
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: StreamDeletionMeta,SdmBySeq
dotnet_method: IsSubjectDeleteMarker
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isSubjectDeleteMarker returns whether the headers indicate this message is a subject delete marker.
Either it's a usual marker with JSMarkerReason, or it's a KV Purge marker as the KVOperation.


name: validateAndNormalizeCompressionOption
go_file: server/server.go
go_method: validateAndNormalizeCompressionOption
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ValidateAndNormalizeCompressionOption
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
For a given user provided string, matches to one of the compression mode
constant and updates the provided string to that constant. Returns an
error if the provided compression mode is not known.
The parameter `chosenModeForOn` indicates which compression mode to use
when the user selects "on" (or enabled, true, etc..). This is because
we may have different defaults depending on where the compression is used.


name: needsCompression
go_file: server/server.go
go_method: needsCompression
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NeedsCompression
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns `true` if the compression mode `m` indicates that the server
will negotiate compression with the remote server, `false` otherwise.
Note that the provided compression mode is assumed to have been
normalized and validated.


name: selectCompressionMode
go_file: server/server.go
go_method: selectCompressionMode
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SelectCompressionMode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Compression is asymmetric, meaning that one side can have a different
compression level than the other. However, we need to check for cases
when this server `scm` or the remote `rcm` do not support compression
(say older server, or test to make it behave as it is not), or have
the compression off.
Note that `scm` is assumed to not be "off" or "not supported".


name: compressionModeForInfoProtocol
go_file: server/server.go
go_method: compressionModeForInfoProtocol
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CompressionModeForInfoProtocol
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If the configured compression mode is "auto" then will return that,
otherwise will return the given `cm` compression mode.


name: selectS2AutoModeBasedOnRTT
go_file: server/server.go
go_method: selectS2AutoModeBasedOnRTT
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SelectS2AutoModeBasedOnRTT
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Given a connection RTT and a list of thresholds durations, this
function will return an S2 compression level such as "uncompressed",
"fast", "better" or "best". For instance, with the following slice:
[5ms, 10ms, 15ms, 20ms], a RTT of up to 5ms will result
in the compression level "uncompressed", ]5ms..10ms] will result in
"fast" compression, etc..
However, the 0 value allows for disabling of some compression levels.
For instance, the following slice: [0, 0, 20, 30] means that a RTT of
[0..20ms] would result in the "better" compression - effectively disabling
the use of "uncompressed" and "fast", then anything above 20ms would
result in the use of "best" level (the 30 in the list has no effect
and the list could have been simplified to [0, 0, 20]).


name: s2WriterOptions
go_file: server/server.go
go_method: s2WriterOptions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: S2WriterOptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns an array of s2 WriterOption based on the route compression mode.
So far we return a single option, but this way we can call s2.NewWriter()
with a nil []s2.WriterOption, but not with a nil s2.WriterOption, so
this is more versatile.


name: NewServer
go_file: server/server.go
go_method: NewServer
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NewServer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
NewServer will setup a new server struct after parsing the options.
Could return an error if options can not be validated.
The provided Options type should not be re-used afterwards.
Either use Options.Clone() to pass a copy, or make a new one.


name: Server.initRouteStructures
go_file: server/server.go
go_class: Server
go_method: initRouteStructures
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InitRouteStructures
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Initializes route structures based on pooling and/or per-account routes.

Server lock is held on entry


name: Server.ClientURL
go_file: server/server.go
go_class: Server
go_method: ClientURL
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ClientURL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ClientURL returns the URL used to connect clients.
Helpful in tests and with in-process servers using a random client port (-1).


name: Server.WebsocketURL
go_file: server/server.go
go_class: Server
go_method: WebsocketURL
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: WebsocketURL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
WebsocketURL returns the URL used to connect websocket clients.
Helpful in tests and with in-process servers using a random websocket port (-1).


name: Server.configureAccounts
go_file: server/server.go
go_class: Server
go_method: configureAccounts
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ConfigureAccounts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Used to setup or update Accounts.
Returns a map that indicates which accounts have had their stream imports
changed (in case of an update in configuration reload).
Lock is held upon entry, but will be released/reacquired in this function.


name: Server.configureResolver
go_file: server/server.go
go_class: Server
go_method: configureResolver
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ConfigureResolver
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Setup the account resolver. For memory resolver, make sure the JWTs are
properly formed but do not enforce expiration etc.
Lock is held on entry, but may be released/reacquired during this call.


name: Server.isTrustedIssuer
go_file: server/server.go
go_class: Server
go_method: isTrustedIssuer
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: IsTrustedIssuer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isTrustedIssuer will check that the issuer is a trusted public key.
This is used to make sure an account was signed by a trusted operator.


name: Server.initStampedTrustedKeys
go_file: server/server.go
go_class: Server
go_method: initStampedTrustedKeys
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InitStampedTrustedKeys
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
initStampedTrustedKeys will check the stamped trusted keys
and will set the server field 'trustedKeys'. Returns whether
it succeeded or not.


name: ProcessCommandLineArgs
go_file: server/server.go
go_method: ProcessCommandLineArgs
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ProcessCommandLineArgs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ProcessCommandLineArgs takes the command line arguments
validating and setting flags for handling in case any
sub command was present.


name: Server.numReservedAccounts
go_file: server/server.go
go_class: Server
go_method: numReservedAccounts
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NumReservedAccounts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
numReservedAccounts will return the number of reserved accounts configured in the server.
Currently this is 1, one for the global default account.


name: Server.numAccounts
go_file: server/server.go
go_class: Server
go_method: numAccounts
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: NumAccounts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This should be used for testing only. Will be slow since we have to
range over all accounts in the sync.Map to count.


name: Server.SetSystemAccount
go_file: server/server.go
go_class: Server
go_method: SetSystemAccount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SetSystemAccount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
SetSystemAccount will set the internal system account.
If root operators are present it will also check validity.


name: Server.setSystemAccount
go_file: server/server.go
go_class: Server
go_method: setSystemAccount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SetSystemAccountInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Assign a system account. Should only be called once.
This sets up a server to send and receive messages from
inside the server itself.


name: Server.shouldTrackSubscriptions
go_file: server/server.go
go_class: Server
go_method: shouldTrackSubscriptions
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ShouldTrackSubscriptions
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Determine if accounts should track subscriptions for
efficient propagation.
Lock should be held on entry.


name: Server.registerAccount
go_file: server/server.go
go_class: Server
go_method: registerAccount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RegisterAccountInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Invokes registerAccountNoLock under the protection of the server lock.
That is, server lock is acquired/released in this function.
See registerAccountNoLock for comment on returned value.


name: Server.registerAccountNoLock
go_file: server/server.go
go_class: Server
go_method: registerAccountNoLock
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RegisterAccountNoLock
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Registers an account in the server.
Due to some locking considerations, we may end-up trying
to register the same account twice. This function will
then return the already registered account.
Lock should be held on entry.


name: Server.setRouteInfo
go_file: server/server.go
go_class: Server
go_method: setRouteInfo
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SetRouteInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Sets the account's routePoolIdx depending on presence or not of
pooling or per-account routes. Also updates a map used by
gateway code to retrieve a route based on some route hash.

Both Server and Account lock held on entry.


name: Server.lookupAccount
go_file: server/server.go
go_class: Server
go_method: lookupAccount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: LookupAccountInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
lookupAccount is a function to return the account structure
associated with an account name.
Lock MUST NOT be held upon entry.


name: Server.lookupOrFetchAccount
go_file: server/server.go
go_class: Server
go_method: lookupOrFetchAccount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: LookupOrFetchAccount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
lookupOrFetchAccount is a function to return the account structure
associated with an account name.
Lock MUST NOT be held upon entry.


name: Server.updateAccount
go_file: server/server.go
go_class: Server
go_method: updateAccount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateAccount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will fetch new claims and if found update the account with new claims.
Lock MUST NOT be held upon entry.


name: Server.fetchRawAccountClaims
go_file: server/server.go
go_class: Server
go_method: fetchRawAccountClaims
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: FetchRawAccountClaims
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
fetchRawAccountClaims will grab raw account claims iff we have a resolver.
Lock is NOT held upon entry.


name: Server.fetchAccountClaims
go_file: server/server.go
go_class: Server
go_method: fetchAccountClaims
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: FetchAccountClaims
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
fetchAccountClaims will attempt to fetch new claims if a resolver is present.
Lock is NOT held upon entry.


name: Server.Start
go_file: server/server.go
go_class: Server
go_method: Start
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: Start
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Start up the server, this will not block.

WaitForShutdown can be used to block and wait for the server to shutdown properly if needed
after calling s.Shutdown()


name: Server.Shutdown
go_file: server/server.go
go_class: Server
go_method: Shutdown
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: Shutdown
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Shutdown will shutdown the server instance by kicking out the AcceptLoop
and closing all associated clients.


name: Server.getServerListener
go_file: server/server.go
go_class: Server
go_method: getServerListener
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetServerListener
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
getServerListener returns a network listener for the given host-port address.
If the Server already has an active listener (s.listener), it returns that listener
along with any previous error (s.listenerErr). Otherwise, it creates and returns
a new TCP listener on the specified address using natsListen.


name: Server.InProcessConn
go_file: server/server.go
go_class: Server
go_method: InProcessConn
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: InProcessConn
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
InProcessConn returns an in-process connection to the server,
avoiding the need to use a TCP listener for local connectivity
within the same process. This can be used regardless of the
state of the DontListen option.


name: Server.setInfoHostPort
go_file: server/server.go
go_class: Server
go_method: setInfoHostPort
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SetInfoHostPort
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This function sets the server's info Host/Port based on server Options.
Note that this function may be called during config reload, this is why
Host/Port may be reset to original Options if the ClientAdvertise option
is not set (since it may have previously been).


name: Server.getMonitoringTLSConfig
go_file: server/server.go
go_class: Server
go_method: getMonitoringTLSConfig
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetMonitoringTLSConfig
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
The TLS configuration is passed to the listener when the monitoring
"server" is setup. That prevents TLS configuration updates on reload
from being used. By setting this function in tls.Config.GetConfigForClient
we instruct the TLS handshake to ask for the tls configuration to be
used for a specific client. We don't care which client, we always use
the same TLS configuration.


name: Server.HTTPHandler
go_file: server/server.go
go_class: Server
go_method: HTTPHandler
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: HTTPHandler
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
HTTPHandler returns the http.Handler object used to handle monitoring
endpoints. It will return nil if the server is not configured for
monitoring, or if the server has not been started yet (Server.Start()).


name: Server.copyInfo
go_file: server/server.go
go_class: Server
go_method: copyInfo
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CopyInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Perform a conditional deep copy due to reference nature of [Client|WS]ConnectURLs.
If updates are made to Info, this function should be consulted and updated.
Assume lock is held.


name: Server.saveClosedClient
go_file: server/server.go
go_class: Server
go_method: saveClosedClient
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SaveClosedClient
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will save off a closed client in a ring buffer such that
/connz can inspect. Useful for debugging, etc.


name: Server.addConnectURLsAndSendINFOToClients
go_file: server/server.go
go_class: Server
go_method: addConnectURLsAndSendINFOToClients
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AddConnectURLsAndSendINFOToClients
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Adds to the list of client and websocket clients connect URLs.
If there was a change, an INFO protocol is sent to registered clients
that support async INFO protocols.
Server lock held on entry.


name: Server.removeConnectURLsAndSendINFOToClients
go_file: server/server.go
go_class: Server
go_method: removeConnectURLsAndSendINFOToClients
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RemoveConnectURLsAndSendINFOToClients
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Removes from the list of client and websocket clients connect URLs.
If there was a change, an INFO protocol is sent to registered clients
that support async INFO protocols.
Server lock held on entry.


name: Server.updateServerINFOAndSendINFOToClients
go_file: server/server.go
go_class: Server
go_method: updateServerINFOAndSendINFOToClients
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: UpdateServerINFOAndSendINFOToClients
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Updates the list of client and websocket clients connect URLs and if any change
sends an async INFO update to clients that support it.
Server lock held on entry.


name: Server.removeProxiedConn
go_file: server/server.go
go_class: Server
go_method: removeProxiedConn
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: RemoveProxiedConn
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Remove the connection with id `cid` from the map of connections
under the public key `key` of the trusted proxies.

Server lock must be held on entry.


name: Server.ReadyForConnections
go_file: server/server.go
go_class: Server
go_method: ReadyForConnections
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ReadyForConnections
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ReadyForConnections returns `true` if the server is ready to accept clients
and, if routing is enabled, route connections. If after the duration
`dur` the server is still not ready, returns `false`.


name: Server.getClientConnectURLs
go_file: server/server.go
go_class: Server
go_method: getClientConnectURLs
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetClientConnectURLs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
getClientConnectURLs returns suitable URLs for clients to connect to the listen
port based on the server options' Host and Port. If the Host corresponds to
"any" interfaces, this call returns the list of resolved IP addresses.
If ClientAdvertise is set, returns the client advertise host and port.
The server lock is assumed held on entry.


name: Server.getConnectURLs
go_file: server/server.go
go_class: Server
go_method: getConnectURLs
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetConnectURLs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Generic version that will return an array of URLs based on the given
advertise, host and port values.


name: Server.getNonLocalIPsIfHostIsIPAny
go_file: server/server.go
go_class: Server
go_method: getNonLocalIPsIfHostIsIPAny
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: GetNonLocalIPsIfHostIsIPAny
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns an array of non local IPs if the provided host is
0.0.0.0 or ::. It returns the first resolved if `all` is
false.
The boolean indicate if the provided host was 0.0.0.0 (or ::)
so that if the returned array is empty caller can decide
what to do next.


name: Server.PortsInfo
go_file: server/server.go
go_class: Server
go_method: PortsInfo
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: PortsInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
PortsInfo attempts to resolve all the ports. If after maxWait the ports are not
resolved, it returns nil. Otherwise it returns a Ports struct
describing ports where the server can be contacted


name: Server.portFile
go_file: server/server.go
go_class: Server
go_method: portFile
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: PortFile
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns the portsFile. If a non-empty dirHint is provided, the dirHint
path is used instead of the server option value


name: Server.deletePortsFile
go_file: server/server.go
go_class: Server
go_method: deletePortsFile
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: DeletePortsFile
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Delete the ports file. If a non-empty dirHint is provided, the dirHint
path is used instead of the server option value


name: Server.logPorts
go_file: server/server.go
go_class: Server
go_method: logPorts
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: LogPorts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Writes a file with a serialized Ports to the specified ports_file_dir.
The name of the file is `exename_pid.ports`, typically nats-server_pid.ports.
if ports file is not set, this function has no effect


name: Server.serviceListeners
go_file: server/server.go
go_class: Server
go_method: serviceListeners
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ServiceListeners
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
returns a list of listeners that are intended for the process
if the entry is nil, the interface is yet to be resolved


name: Server.LameDuckShutdown
go_file: server/server.go
go_class: Server
go_method: LameDuckShutdown
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: LameDuckShutdown
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
LameDuckShutdown will perform a lame duck shutdown of NATS, whereby
the client listener is closed, existing client connections are
kicked, Raft leaderships are transferred, JetStream is shutdown
and then finally shutdown the the NATS Server itself.
This function blocks and will not return until the NATS Server
has completed the entire shutdown operation.


name: Server.lameDuckMode
go_file: server/server.go
go_class: Server
go_method: lameDuckMode
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: LameDuckMode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This function will close the client listener then close the clients
at some interval to avoid a reconnect storm.
We will also transfer any raft leaders and shutdown JetStream.


name: Server.sendLDMToRoutes
go_file: server/server.go
go_class: Server
go_method: sendLDMToRoutes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendLDMToRoutes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Send an INFO update to routes with the indication that this server is in LDM mode.
Server lock is held on entry.


name: Server.sendLDMToClients
go_file: server/server.go
go_class: Server
go_method: sendLDMToClients
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: SendLDMToClients
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Send an INFO update to clients with the indication that this server is in
LDM mode and with only URLs of other nodes.
Server lock is held on entry.


name: Server.acceptError
go_file: server/server.go
go_class: Server
go_method: acceptError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: AcceptError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If given error is a net.Error and is temporary, sleeps for the given
delay and double it, but cap it to ACCEPT_MAX_SLEEP. The sleep is
interrupted if the server is shutdown.
An error message is displayed depending on the type of error.
Returns the new (or unchanged) delay, or a negative value if the
server has been or is being shutdown.


name: Server.shouldReportConnectErr
go_file: server/server.go
go_class: Server
go_method: shouldReportConnectErr
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: ShouldReportConnectErr
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns true for the first attempt and depending on the nature
of the attempt (first connect or a reconnect), when the number
of attempts is equal to the configured report attempts.


name: Run
go_file: server/service.go
go_method: Run
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServiceManager
dotnet_method: Run
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:35:12
description:
Run starts the NATS server. This wrapper function allows Windows to add a
hook for running NATS as a service.


name: winServiceWrapper.Execute
go_file: server/service_windows.go
go_class: winServiceWrapper
go_method: Execute
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServiceManager
dotnet_method: Execute
notes: Windows-specific Go code. Replaced by Microsoft.Extensions.Hosting.WindowsServices in .NET.
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 12:35:12
description:
Execute will be called by the package code at the start of
the service, and the service will exit once Execute completes.
Inside Execute you must read service change requests from r and
act accordingly. You must keep service control manager up to date
about state of your service by writing into s as required.
args contains service name followed by argument strings passed
to the service.
You can provide service exit code in exitCode return parameter,
with 0 being "no error". You can also indicate if exit code,
if any, is service specific or not by using svcSpecificEC
parameter.


name: ProcessSignal
go_file: server/signal.go
go_method: ProcessSignal
status: n_a
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SignalHandler
dotnet_method: ProcessSignal
notes: .NET uses IHostApplicationLifetime
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ProcessSignal sends the given signal command to the given process. If pidStr
is empty, this will send the signal to the single running instance of
nats-server. If multiple instances are running, pidStr can be a globular
expression ending with '*'. This returns an error if the given process is
not running or the command is invalid.


name: ProcessSignal
go_file: server/signal_windows.go
go_method: ProcessSignal
status: n_a
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SignalHandler
dotnet_method: ProcessSignal
notes: .NET uses IHostApplicationLifetime
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ProcessSignal sends the given signal command to the running nats-server service.
If service is empty, this signals the "nats-server" service. This returns an
error is the given service is not running or the command is invalid.


name: bytesToString
go_file: server/store.go
go_method: bytesToString
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: StorageType
dotnet_method: BytesToString
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 16:48:46
description:
Note this will avoid a copy of the data used for the string, but it will also reference the existing slice's data pointer.
So this should be used sparingly when we know the encompassing byte slice's lifetime is the same.


name: copyString
go_file: server/store.go
go_method: copyString
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: StorageType
dotnet_method: CopyString
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 16:48:46
description:
Forces a copy of a string, for use in the case that you might have been passed a value when bytesToString was used,
but now you need a separate copy of it to store for longer-term use.


name: StreamConfig.clone
go_file: server/stream.go
go_class: StreamConfig
go_method: clone
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: StreamConfig
dotnet_method: Clone
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
clone performs a deep copy of the StreamConfig struct, returning a new clone with
all values copied.


name: JSPubAckResponse.ToError
go_file: server/stream.go
go_class: JSPubAckResponse
go_method: ToError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JSPubAckResponse
dotnet_method: ToError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ToError checks if the response has a error and if it does converts it to an error
avoiding the pitfalls described by https://yourbasic.org/golang/gotcha-why-nil-error-not-equal-nil/


name: StreamSource.composeIName
go_file: server/stream.go
go_class: StreamSource
go_method: composeIName
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: StreamSource
dotnet_method: ComposeIName
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Composes the index name. Contains the stream name, subject filter, and transform destination
when the stream is external we will use the api prefix as part of the index name
(as the same stream name could be used in multiple JS domains)


name: stream.isLeaderNodeState
go_file: server/stream.go
go_class: stream
go_method: isLeaderNodeState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: IsLeaderNodeState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
isLeaderNodeState should NOT be used normally, use isLeader instead.
Returns whether the node thinks it is the leader, regardless of whether applies are up-to-date yet
(unlike isLeader, which requires applies to be caught up).
May be used to respond to clients after a leader change, when applying entries from a former leader.
Lock should be held.


name: stream.autoTuneFileStorageBlockSize
go_file: server/stream.go
go_class: stream
go_method: autoTuneFileStorageBlockSize
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: AutoTuneFileStorageBlockSize
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If we are file based and the file storage config was not explicitly set
we can autotune block sizes to better match. Our target will be to store 125%
of the theoretical limit. We will round up to nearest 100 bytes as well.


name: stream.rebuildDedupe
go_file: server/stream.go
go_class: stream
go_method: rebuildDedupe
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: RebuildDedupe
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
rebuildDedupe will rebuild any dedupe structures needed after recovery of a stream.
Will be called lazily to avoid penalizing startup times.
TODO(dlc) - Might be good to know if this should be checked at all for streams with no
headers and msgId in them. Would need signaling from the storage layer.
mset.mu and mset.ddMu locks should be held.


name: jsAccount.subjectsOverlap
go_file: server/stream.go
go_class: jsAccount
go_method: subjectsOverlap
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: JsAccount
dotnet_method: SubjectsOverlap
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
subjectsOverlap to see if these subjects overlap with existing subjects.
Use only for non-clustered JetStream
RLock minimum should be held.


name: stream.getCfgName
go_file: server/stream.go
go_class: stream
go_method: getCfgName
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: GetCfgName
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Small helper to return the Name field from mset.cfg, protected by
the mset.cfgMu mutex. This is simply because we have several places
in consumer.go where we need it.


name: stream.retryDisconnectedSyncConsumers
go_file: server/stream.go
go_class: stream
go_method: retryDisconnectedSyncConsumers
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: RetryDisconnectedSyncConsumers
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
retryDisconnectedSyncConsumers() will check if we have any disconnected
sync consumers for either mirror or a source and will reset and retry to connect.


name: sourceInfo.isCurrentSub
go_file: server/stream.go
go_class: sourceInfo
go_method: isCurrentSub
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: StreamSourceInfo
dotnet_method: IsCurrentSub
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Checks that the message is from our current direct consumer. We can not depend on sub comparison
since cross account imports break.


name: stream.retryMirrorConsumer
go_file: server/stream.go
go_class: stream
go_method: retryMirrorConsumer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: RetryMirrorConsumer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Similar to setupMirrorConsumer except that it will print a debug statement
indicating that there is a retry.

Lock is acquired in this function


name: stream.scheduleSetupMirrorConsumerRetry
go_file: server/stream.go
go_class: stream
go_method: scheduleSetupMirrorConsumerRetry
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: ScheduleSetupMirrorConsumerRetry
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will schedule a call to setupMirrorConsumer, taking into account the last
time it was retried and determine the soonest setupMirrorConsumer can be called
without tripping the sourceConsumerRetryThreshold. We will also take into account
number of failures and will back off our retries.
The mset.mirror pointer has been verified to be not nil by the caller.

Lock held on entry


name: stream.cancelSourceInfo
go_file: server/stream.go
go_class: stream
go_method: cancelSourceInfo
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: CancelSourceInfo
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
The `si` has been verified to be not nil. The sourceInfo's sub will
be unsubscribed and set to nil (if not already done) and the
cname will be reset. The message processing's go routine quit channel
will be closed if still opened.

Lock should be held


name: stream.setupSourceConsumer
go_file: server/stream.go
go_class: stream
go_method: setupSourceConsumer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: SetupSourceConsumer
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is the main function to call when needing to setup a new consumer for the source.
It actually only does the scheduling of the execution of trySetupSourceConsumer in order to implement retry backoff
and throttle the number of requests.
Lock should be held.


name: stream.processAllSourceMsgs
go_file: server/stream.go
go_class: stream
go_method: processAllSourceMsgs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: ProcessAllSourceMsgs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will process all inbound source msgs.
We mux them into one go routine to avoid lock contention and high cpu and thread thrashing.
TODO(dlc) make this more then one and pin sources to one of a group.


name: stream.handleFlowControl
go_file: server/stream.go
go_class: stream
go_method: handleFlowControl
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: HandleFlowControl
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
handleFlowControl will properly handle flow control messages for both R==1 and R>1.
Lock should be held.


name: sourceInfo.genSourceHeader
go_file: server/stream.go
go_class: sourceInfo
go_method: genSourceHeader
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: StreamSourceInfo
dotnet_method: GenSourceHeader
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Generate a new (2.10) style source header (stream name, sequence number, source filter, source destination transform).


name: streamAndSeq
go_file: server/stream.go
go_method: streamAndSeq
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: StreamAndSeq
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Extract the stream name, the source index name and the message sequence number from the source header.
Uses the filter and transform arguments to provide backwards compatibility


name: stream.startingSequenceForSources
go_file: server/stream.go
go_class: stream
go_method: startingSequenceForSources
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: StartingSequenceForSources
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will do a reverse scan on startup or leader election
searching for the starting sequence number.
This can be slow in degenerative cases.
Lock should be held.


name: stream.unsubscribeInternal
go_file: server/stream.go
go_class: stream
go_method: unsubscribeInternal
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: UnsubscribeInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will unsubscribe us from the exact subject given.
We do not currently track the subs so do not have the sid.
This should be called only on an update.
Lock does NOT need to be held, we set the client on setup and never change it at this point.


name: stream.storeUpdates
go_file: server/stream.go
go_class: stream
go_method: storeUpdates
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: StoreUpdates
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Called for any updates to the underlying stream. We pass through the bytes to the
jetstream account. We do local processing for stream pending for consumers, but only
for removals.
Lock should not be held.


name: getMessageTTL
go_file: server/stream.go
go_method: getMessageTTL
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: GetMessageTTL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:18:20
description:
Fast lookup of the message TTL from headers:
- Positive return value: duration in seconds.
- Zero return value: no TTL or parse error.
- Negative return value: never expires.


name: parseMessageTTL
go_file: server/stream.go
go_method: parseMessageTTL
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: ParseMessageTTL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
- Positive return value: duration in seconds.
- Zero return value: no TTL or parse error.
- Negative return value: never expires.


name: getMessageScheduleTTL
go_file: server/stream.go
go_method: getMessageScheduleTTL
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: GetMessageScheduleTTL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Fast lookup of the message schedule TTL from headers.
The TTL is confirmed to be valid, but the raw TTL string is returned.


name: stream.getDirectRequest
go_file: server/stream.go
go_class: stream
go_method: getDirectRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: GetDirectRequest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Do actual work on a direct msg request.
This could be called in a Go routine if we are inline for a non-client connection.


name: stream.processJetStreamBatchMsg
go_file: server/stream.go
go_class: stream
go_method: processJetStreamBatchMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: ProcessJetStreamBatchMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
processJetStreamBatchMsg processes a JetStream message that's part of an atomic batch publish.
Handles constraints around the batch, storing messages, doing consistency checks, and performing the commit.


name: stream.setupSendCapabilities
go_file: server/stream.go
go_class: stream
go_method: setupSendCapabilities
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: SetupSendCapabilities
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is similar to system semantics but did not want to overload the single system sendq,
or require system account when doing simple setup with jetstream.


name: stream.checkInterestState
go_file: server/stream.go
go_class: stream
go_method: checkInterestState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: CheckInterestState
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Will check for interest retention and make sure messages
that have been acked are processed and removed.
This will check the ack floors of all consumers, and adjust our first sequence accordingly.


name: stream.noInterest
go_file: server/stream.go
go_class: stream
go_method: noInterest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: NoInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Check if there is no interest in this sequence number across our consumers.
The consumer passed is optional if we are processing the ack for that consumer.
Write lock should be held.


name: stream.noInterestWithSubject
go_file: server/stream.go
go_class: stream
go_method: noInterestWithSubject
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: NoInterestWithSubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Check if there is no interest in this sequence number and subject across our consumers.
The consumer passed is optional if we are processing the ack for that consumer.
Write lock should be held.


name: stream.registerPreAck
go_file: server/stream.go
go_class: stream
go_method: registerPreAck
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: RegisterPreAck
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will register an ack for a consumer if it arrives before
the actual message.
Write lock should be held.


name: stream.ackMsg
go_file: server/stream.go
go_class: stream
go_method: ackMsg
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: AckMsg
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
ackMsg is called into from a consumer when we have a WorkQueue or Interest Retention Policy.
Returns whether the message at seq was removed as a result of the ACK.
(Or should be removed in the case of clustered streams, since it requires a message delete proposal)


name: stream.checkForOrphanMsgs
go_file: server/stream.go
go_class: stream
go_method: checkForOrphanMsgs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: CheckForOrphanMsgs
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is to check for dangling messages on interest retention streams. Only called on account enable.
Issue https://github.com/nats-io/nats-server/issues/3612


name: stream.checkConsumerReplication
go_file: server/stream.go
go_class: stream
go_method: checkConsumerReplication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsStream
dotnet_method: CheckConsumerReplication
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Check on startup to make sure that consumers replication matches us.
Interest retention requires replication matches.


name: indexPlaceHolders
go_file: server/subject_transform.go
go_method: indexPlaceHolders
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTransform
dotnet_method: IndexPlaceHolders
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper to ingest and index the subjectTransform destination token (e.g. $x or {{}}) in the token
returns a transformation type, and three function arguments: an array of source subject token indexes,
and a single number (e.g. number of partitions, or a slice size), and a string (e.g.a split delimiter)


name: transformTokenize
go_file: server/subject_transform.go
go_method: transformTokenize
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTransform
dotnet_method: TransformTokenize
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper function to tokenize subjects with partial wildcards into formal transform destinations.
e.g. "foo.*.*" -> "foo.$1.$2"


name: transformUntokenize
go_file: server/subject_transform.go
go_method: transformUntokenize
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTransform
dotnet_method: TransformUntokenize
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Helper function to go from transform destination to a subject with partial wildcards and ordered list of placeholders
E.g.:

		"bar" -> "bar", []
		"foo.$2.$1" -> "foo.*.*", ["$2","$1"]
	    "foo.{{wildcard(2)}}.{{wildcard(1)}}" -> "foo.*.*", ["{{wildcard(2)}}","{{wildcard(1)}}"]


name: subjectTransform.Match
go_file: server/subject_transform.go
go_class: subjectTransform
go_method: Match
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTransform
dotnet_method: Match
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Match will take a literal published subject that is associated with a client and will match and subjectTransform
the subject if possible.

This API is not part of the public API and not subject to SemVer protections


name: subjectTransform.TransformSubject
go_file: server/subject_transform.go
go_class: subjectTransform
go_method: TransformSubject
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTransform
dotnet_method: TransformSubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
TransformSubject transforms a subject

This API is not part of the public API and not subject to SemVer protection


name: Sublist.RegisterNotification
go_file: server/sublist.go
go_class: Sublist
go_method: RegisterNotification
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: RegisterNotification
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
RegisterNotification will register for notifications when interest for the given
subject changes. The subject must be a literal publish type subject.
The notification is true for when the first interest for a subject is inserted,
and false when all interest in the subject is removed. Note that this interest
needs to be exact and that wildcards will not trigger the notifications. The sublist
will not block when trying to send the notification. Its up to the caller to make
sure the channel send will not block.


name: Sublist.chkForInsertNotification
go_file: server/sublist.go
go_class: Sublist
go_method: chkForInsertNotification
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: ChkForInsertNotification
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
chkForInsertNotification will check to see if we need to notify on this subject.
Write lock should be held.


name: Sublist.chkForRemoveNotification
go_file: server/sublist.go
go_class: Sublist
go_method: chkForRemoveNotification
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: ChkForRemoveNotification
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
chkForRemoveNotification will check to see if we need to notify on this subject.
Write lock should be held.


name: Sublist.addToCache
go_file: server/sublist.go
go_class: Sublist
go_method: addToCache
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: AddToCache
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
addToCache will add the new entry to the existing cache
entries if needed. Assumes write lock is held.
Assumes write lock is held.


name: Sublist.NumInterest
go_file: server/sublist.go
go_class: Sublist
go_method: NumInterest
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: NumInterest
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
NumInterest will return the number of subs/qsubs interested in the subject.
In cases where more detail is not required, this may be faster than Match.


name: Sublist.reduceCacheCount
go_file: server/sublist.go
go_class: Sublist
go_method: reduceCacheCount
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: ReduceCacheCount
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Remove entries in the cache until we are under the maximum.
TODO(dlc) this could be smarter now that its not inline.


name: findQSlot
go_file: server/sublist.go
go_method: findQSlot
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: FindQSlot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
We do not use a map here since we want iteration to be past when
processing publishes in L1 on client. So we need to walk sequentially
for now. Keep an eye on this in case we start getting large number of
different queue subscribers for the same subject.


name: subjectIsLiteral
go_file: server/sublist.go
go_method: subjectIsLiteral
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: SubjectIsLiteral
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Determine if the subject has any wildcards. Fast version, does not check for
valid subject. Used in caching layer.


name: IsValidLiteralSubject
go_file: server/sublist.go
go_method: IsValidLiteralSubject
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: IsValidLiteralSubject
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
IsValidLiteralSubject returns true if a subject is valid and literal (no wildcards), false otherwise


name: isValidLiteralSubject
go_file: server/sublist.go
go_method: isValidLiteralSubject
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: IsValidLiteralSubjectInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 11:09:32
description:
isValidLiteralSubject returns true if the tokens are valid and literal (no wildcards), false otherwise


name: isSubsetMatch
go_file: server/sublist.go
go_method: isSubsetMatch
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: IsSubsetMatch
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will test a subject as an array of tokens against a test subject
Calls into the function isSubsetMatchTokenized


name: isSubsetMatchTokenized
go_file: server/sublist.go
go_method: isSubsetMatchTokenized
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: IsSubsetMatchTokenized
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This will test a subject as an array of tokens against a test subject (also encoded as array of tokens)
and determine if the tokens are matched. Both test subject and tokens
may contain wildcards. So foo.* is a subset match of [">", "*.*", "foo.*"],
but not of foo.bar, etc.


name: matchLiteral
go_file: server/sublist.go
go_method: matchLiteral
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: MatchLiteral
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
matchLiteral is used to test literal subjects, those that do not have any
wildcards, with a target subject. This is used in the cache layer.


name: Sublist.ReverseMatch
go_file: server/sublist.go
go_class: Sublist
go_method: ReverseMatch
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubscriptionIndex
dotnet_method: ReverseMatch
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
For a given subject (which may contain wildcards), this call returns all
subscriptions that would match that subject. For instance, suppose that
the sublist contains: foo.bar, foo.bar.baz and foo.baz, ReverseMatch("foo.*")
would return foo.bar and foo.baz.
This is used in situations where the sublist is likely to contain only
literals and one wants to get all the subjects that would have been a match
to a subscription on `subject`.


name: parseHostPort
go_file: server/util.go
go_method: parseHostPort
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: ParseHostPort
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Parse a host/port string with a default port to use
if none (or 0 or -1) is specified in `hostPort` string.


name: comma
go_file: server/util.go
go_method: comma
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: Comma
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
comma produces a string form of the given number in base 10 with
commas after every three orders of magnitude.

e.g. comma(834142) -> 834,142

This function was copied from the github.com/dustin/go-humanize
package (MIT License) and is Copyright Dustin Sallings <dustin@spy.net>


name: refCountedUrlSet.addUrl
go_file: server/util.go
go_class: refCountedUrlSet
go_method: addUrl
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: AddUrl
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:24:29
description:
Adds urlStr to the given map. If the string was already present, simply
bumps the reference count.
Returns true only if it was added for the first time.


name: refCountedUrlSet.removeUrl
go_file: server/util.go
go_class: refCountedUrlSet
go_method: removeUrl
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: RemoveUrl
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:24:29
description:
Removes urlStr from the given map. If the string is not present, nothing
is done and false is returned.
If the string was present, its reference count is decreased. Returns true
if this was the last reference, false otherwise.


name: natsListen
go_file: server/util.go
go_method: natsListen
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: NatsListen
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
natsListen() is the same as net.Listen() except that TCP keepalives are
disabled (to match Go's behavior before Go 1.13).


name: natsDialTimeout
go_file: server/util.go
go_method: natsDialTimeout
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: NatsDialTimeout
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:24:29
description:
natsDialTimeout is the same as net.DialTimeout() except the TCP keepalives
are disabled (to match Go's behavior before Go 1.13).


name: redactURLList
go_file: server/util.go
go_method: redactURLList
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: RedactURLList
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
redactURLList() returns a copy of a list of URL pointers where each item
in the list will either be the same pointer if the URL does not contain a
password, or to a new object if there is a password.
The intended use-case is for logging lists of URLs safely.


name: copyBytes
go_file: server/util.go
go_method: copyBytes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: CopyBytes
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
copyBytes make a new slice of the same size as `src` and copy its content.
If `src` is nil or its length is 0, then this returns `nil`


name: copyStrings
go_file: server/util.go
go_method: copyStrings
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: CopyStrings
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
copyStrings make a new slice of the same size than `src` and copy its content.
If `src` is nil, then this returns `nil`


name: parallelTaskQueue
go_file: server/util.go
go_method: parallelTaskQueue
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ServerUtilities
dotnet_method: ParallelTaskQueue
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:24:29
description:
parallelTaskQueue starts a number of goroutines and returns a channel
which functions can be sent to for queued parallel execution. The
goroutines will stop running when the returned channel is closed and
all queued tasks have completed. The passed in mp limits concurrency,
or a value <= 0 will default to GOMAXPROCS.


name: wsGet
go_file: server/websocket.go
go_method: wsGet
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: WebSocketHandler
dotnet_method: WsGet
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Returns a slice containing `needed` bytes from the given buffer `buf`
starting at position `pos`, and possibly read from the given reader `r`.
When bytes are present in `buf`, the `pos` is incremented by the number
of bytes found up to `needed` and the new position is returned. If not
enough bytes are found, the bytes found in `buf` are copied to the returned
slice and the remaning bytes are read from `r`.


name: client.wsRead
go_file: server/websocket.go
go_class: client
go_method: wsRead
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: WsRead
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Returns a slice of byte slices corresponding to payload of websocket frames.
The byte slice `buf` is filled with bytes from the connection's read loop.
This function will decode the frame headers and unmask the payload(s).
It is possible that the returned slices point to the given `buf` slice, so
`buf` should not be overwritten until the returned slices have been parsed.

Client lock MUST NOT be held on entry.


name: wsReadInfo.decompress
go_file: server/websocket.go
go_class: wsReadInfo
go_method: decompress
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: WsReadInfo
dotnet_method: Decompress
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
decompress decompresses the collected buffers.
The size of the decompressed buffer will be limited to the `mpay` value.
If, while decompressing, the resulting uncompressed buffer exceeds this
limit, the decompression stops and an empty buffer and the ErrMaxPayload
error are returned.


name: wsCreateFrameHeader
go_file: server/websocket.go
go_method: wsCreateFrameHeader
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: WebSocketHandler
dotnet_method: WsCreateFrameHeader
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Create the frame header.
Encodes the frame type and optional compression flag, and the size of the payload.


name: client.wsEnqueueControlMessageLocked
go_file: server/websocket.go
go_class: client
go_method: wsEnqueueControlMessageLocked
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: WsEnqueueControlMessageLocked
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Enqueues a websocket control message.
If the control message is a wsCloseMessage, then marks this client
has having sent the close message (since only one should be sent).
This will prevent the generic closeConnection() to enqueue one.

Client lock held on entry.


name: client.wsEnqueueCloseMessage
go_file: server/websocket.go
go_class: client
go_method: wsEnqueueCloseMessage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: WsEnqueueCloseMessage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Enqueues a websocket close message with a status mapped from the given `reason`.

Client lock held on entry


name: client.wsHandleProtocolError
go_file: server/websocket.go
go_class: client
go_method: wsHandleProtocolError
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: ClientConnection
dotnet_method: WsHandleProtocolError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:26:35
description:
Create and then enqueue a close message with a protocol error and the
given message. This is invoked when parsing websocket frames.

Lock MUST NOT be held on entry.


name: wsCreateCloseMessage
go_file: server/websocket.go
go_method: wsCreateCloseMessage
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: WebSocketHandler
dotnet_method: WsCreateCloseMessage
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Create a close message with the given `status` and `body`.
If the `body` is more than the maximum allows control frame payload size,
it is truncated and "..." is added at the end (as a hint that message
is not complete).


name: Server.wsUpgrade
go_file: server/websocket.go
go_class: Server
go_method: wsUpgrade
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: WsUpgrade
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Process websocket client handshake. On success, returns the raw net.Conn that
will be used to create a *client object.
Invoked from the HTTP server listening on websocket port.


name: wsReturnHTTPError
go_file: server/websocket.go
go_method: wsReturnHTTPError
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: WebSocketHandler
dotnet_method: WsReturnHTTPError
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Send an HTTP error with the given `status` to the given http response writer `w`.
Return an error created based on the `reason` string.


name: srvWebsocket.checkOrigin
go_file: server/websocket.go
go_class: srvWebsocket
go_method: checkOrigin
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SrvWebsocket
dotnet_method: CheckOrigin
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
If the server is configured to accept any origin, then this function returns
`nil` without checking if the Origin is present and valid. This is also
the case if the request does not have the Origin header.
Otherwise, this will check that the Origin matches the same origin or
any origin in the allowed list.


name: wsAcceptKey
go_file: server/websocket.go
go_method: wsAcceptKey
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: WebSocketHandler
dotnet_method: WsAcceptKey
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Concatenate the key sent by the client with the GUID, then computes the SHA1 hash
and returns it as a based64 encoded string.


name: Server.wsConfigAuth
go_file: server/websocket.go
go_class: Server
go_method: wsConfigAuth
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: WsConfigAuth
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
Given the websocket options, we check if any auth configuration
has been provided. If so, possibly create users/nkey users and
store them in s.websocket.users/nkeys.
Also update a boolean that indicates if auth is required for
websocket clients.
Server lock is held on entry.


name: Server.wsGetTLSConfig
go_file: server/websocket.go
go_class: Server
go_method: wsGetTLSConfig
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: WsGetTLSConfig
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
The TLS configuration is passed to the listener when the websocket
"server" is setup. That prevents TLS configuration updates on reload
from being used. By setting this function in tls.Config.GetConfigForClient
we instruct the TLS handshake to ask for the tls configuration to be
used for a specific client. We don't care which client, we always use
the same TLS configuration.


name: Server.createWSClient
go_file: server/websocket.go
go_class: Server
go_method: createWSClient
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: NatsServer
dotnet_method: CreateWSClient
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 10:21:31
description:
This is similar to createClient() but has some modifications
specific to handle websocket clients.
The comments have been kept to minimum to reduce code size.
Check createClient() for more details.


name: node10.addChild
go_file: server/stree/node10.go
go_class: node10
go_method: addChild
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTreeNode10
dotnet_method: AddChild
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
Currently we do not keep node10 sorted or use bitfields for traversal so just add to the end.
TODO(dlc) - We should revisit here with more detailed benchmarks.


name: node16.addChild
go_file: server/stree/node16.go
go_class: node16
go_method: addChild
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTreeNode16
dotnet_method: AddChild
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
Currently we do not keep node16 sorted or use bitfields for traversal so just add to the end.
TODO(dlc) - We should revisit here with more detailed benchmarks.


name: genParts
go_file: server/stree/parts.go
go_method: genParts
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTreeParts
dotnet_method: GenParts
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
genParts will break a filter subject up into parts.
We need to break this up into chunks based on wildcards, either pwc '*' or fwc '>'.
We do not care about other tokens per se, just parts that are separated by wildcards with an optional end fwc.


name: .Match
go_file: server/stree/stree.go
go_method: Match
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: Match
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
Match will match against a subject that can have wildcards and invoke the callback func for each matched value.


name: .MatchUntil
go_file: server/stree/stree.go
go_method: MatchUntil
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: MatchUntil
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
MatchUntil will match against a subject that can have wildcards and invoke
the callback func for each matched value.
Returning false from the callback will stop matching immediately.
Returns true if matching ran to completion, false if callback stopped it early.


name: .IterOrdered
go_file: server/stree/stree.go
go_method: IterOrdered
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: IterOrdered
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
IterOrdered will walk all entries in the SubjectTree lexicographically. The callback can return false to terminate the walk.


name: .IterFast
go_file: server/stree/stree.go
go_method: IterFast
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: IterFast
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
IterFast will walk all entries in the SubjectTree with no guarantees of ordering. The callback can return false to terminate the walk.


name: .delete
go_file: server/stree/stree.go
go_method: delete
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: DeleteInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
internal function to recursively find the leaf to delete. Will do compaction if the item is found and removed.


name: .match
go_file: server/stree/stree.go
go_method: match
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: MatchInternal
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
Internal function which can be called recursively to match all leaf nodes to a given filter subject which
once here has been decomposed to parts. These parts only care about wildcards, both pwc and fwc.
Returns false if the callback requested to stop matching.


name: LazyIntersect
go_file: server/stree/stree.go
go_method: LazyIntersect
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: LazyIntersect
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
LazyIntersect iterates the smaller of the two provided subject trees and
looks for matching entries in the other. It is lazy in that it does not
aggressively optimize against repeated walks, but is considerably faster
in most cases than intersecting against a potentially large sublist.


name: IntersectGSL
go_file: server/stree/stree.go
go_method: IntersectGSL
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: IntersectGSL
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
IntersectGSL will match all items in the given subject tree that
have interest expressed in the given sublist. The callback will only be called
once for each subject, regardless of overlapping subscriptions in the sublist.


name: hasInterestForTokens
go_file: server/stree/stree.go
go_method: hasInterestForTokens
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTree
dotnet_method: HasInterestForTokens
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
The subject tree can return partial tokens so we need to check starting interest
only from whole tokens when we encounter a tsep.


name: pivot
go_file: server/stree/util.go
go_method: pivot
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: SubjectTreeUtilities
dotnet_method: Pivot
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:32
description:
Can return 127 (DEL) if we have all the subject as prefixes.
We used to use 0, but when that was in the subject would cause infinite recursion in some situations.


name: HashWheel.ExpireTasks
go_file: server/thw/thw.go
go_class: HashWheel
go_method: ExpireTasks
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TimeHashWheel
dotnet_method: ExpireTasks
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:33
description:
ExpireTasks processes all expired tasks using a callback, but only expires a task if the callback returns true.


name: HashWheel.GetNextExpiration
go_file: server/thw/thw.go
go_class: HashWheel
go_method: GetNextExpiration
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TimeHashWheel
dotnet_method: GetNextExpiration
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:33
description:
GetNextExpiration returns the earliest expiration time before the given time.
Returns math.MaxInt64 if no expirations exist before the specified time.


name: HashWheel.Encode
go_file: server/thw/thw.go
go_class: HashWheel
go_method: Encode
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TimeHashWheel
dotnet_method: Encode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:33
description:
Encode writes out the contents of the THW into a binary snapshot
and returns it. The high seq number is included in the snapshot and will
be returned on decode.


name: HashWheel.Decode
go_file: server/thw/thw.go
go_class: HashWheel
go_method: Decode
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TimeHashWheel
dotnet_method: Decode
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:33
description:
Decode snapshots a binary-encoded THW and replaces the contents of this
THW with them. Returns the high seq number from the snapshot.


name: regenerateSRK
description: Gets/Regenerates the Storage Root Key (SRK) from the TPM. Caller MUST flush this handle when done.
go_file: server/tpm/js_ek_tpm_windows.go
go_method: regenerateSRK
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TpmKeyProvider
dotnet_method: RegenerateSRK
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:34
notes:
Windows-only Tpm2Lib internal helper; cross-platform entry point handles PlatformNotSupportedException


name: writeTPMKeysToFile
go_file: server/tpm/js_ek_tpm_windows.go
go_method: writeTPMKeysToFile
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TpmKeyProvider
dotnet_method: WriteTPMKeysToFile
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:34
description:
Writes the private and public blobs to disk in a single file. If the directory does
not exist, it will be created. If the file already exists it will be overwritten.

notes:
Windows-only Tpm2Lib internal helper; cross-platform entry point handles PlatformNotSupportedException


name: readTPMKeysFromFile
go_file: server/tpm/js_ek_tpm_windows.go
go_method: readTPMKeysFromFile
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TpmKeyProvider
dotnet_method: ReadTPMKeysFromFile
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:34
description:
Reads the private and public blobs from a single file. If the file does not exist,
or the file cannot be read and the keys decoded, an error is returned.

notes:
Windows-only Tpm2Lib internal helper; cross-platform entry point handles PlatformNotSupportedException


name: createAndSealJsEncryptionKey
go_file: server/tpm/js_ek_tpm_windows.go
go_method: createAndSealJsEncryptionKey
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TpmKeyProvider
dotnet_method: CreateAndSealJsEncryptionKey
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:34
description:
Creates a new JetStream encryption key, seals it to the TPM, and saves the public and
private blobs to disk in a JSON encoded file. The key is returned as a string.


name: unsealJsEncrpytionKey
go_file: server/tpm/js_ek_tpm_windows.go
go_method: unsealJsEncrpytionKey
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TpmKeyProvider
dotnet_method: UnsealJsEncrpytionKey
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:34
description:
Unseals the JetStream encryption key from the TPM with the provided keys.
The key is returned as a string.


name: LoadJetStreamEncryptionKeyFromTPM
go_file: server/tpm/js_ek_tpm_windows.go
go_method: LoadJetStreamEncryptionKeyFromTPM
status: verified
dotnet_project: ZB.MOM.NatsNet.Server
dotnet_class: TpmKeyProvider
dotnet_method: LoadJetStreamEncryptionKeyFromTPM
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 23:53:34
description:
LoadJetStreamEncryptionKeyFromTPM loads the JetStream encryption key from the TPM.
If the keyfile does not exist, a key will be created and sealed. Public and private blobs
used to decrypt the key in future sessions will be saved to disk in the file provided.
The key will be unsealed and returned only with the correct password and PCR value.


# unit_tests

name: TestGenericSublistHasInterestStartingInRace
go_file: server/gsl/gsl_test.go
go_method: TestGenericSublistHasInterestStartingInRace
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: GenericSubjectListTests
dotnet_method: GenericSublistHasInterestStartingInRace_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestGenericSublistHasInterestStartingInRace tests that HasInterestStartingIn
is safe to call concurrently with modifications to the sublist.


name: TestNewAccountAndRequireNewAlwaysError
go_file: server/accounts_test.go
go_method: TestNewAccountAndRequireNewAlwaysError
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: AccountTests
dotnet_method: NewAccountAndRequireNewAlwaysError_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Clients used to be able to ask that the account be forced to be new.
This was for dynamic sandboxes for demo environments but was never really used.
Make sure it always errors if set.


name: TestMultipleStreamImportsWithSameSubject
go_file: server/accounts_test.go
go_method: TestMultipleStreamImportsWithSameSubject
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: AccountTests
dotnet_method: MultipleStreamImportsWithSameSubject_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This should work with prefixes that are different but we also want it to just work with same subject
being imported from multiple accounts.


name: TestAccountImportDuplicateResponseDeliveryWithLeafnodes
go_file: server/accounts_test.go
go_method: TestAccountImportDuplicateResponseDeliveryWithLeafnodes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: AccountTests
dotnet_method: AccountImportDuplicateResponseDeliveryWithLeafnodes_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:33:32
description:
Test for a bug that would cause duplicate deliveries in certain situations when
service export/imports and leafnodes involved.
https://github.com/nats-io/nats-server/issues/3191


name: TestAuthCalloutOperatorModeBasics
go_file: server/auth_callout_test.go
go_method: TestAuthCalloutOperatorModeBasics
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: AuthCalloutTests
dotnet_method: AuthCalloutOperatorModeBasics_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:35:49
notes:
DEFERRED: requires full operator-mode auth callout integration runtime (external auth service, resolver, multi-account flow)


name: TestAuthCalloutLeafNodeAndConfigMode
go_file: server/auth_callout_test.go
go_method: TestAuthCalloutLeafNodeAndConfigMode
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: AuthCalloutTests
dotnet_method: AuthCalloutLeafNodeAndConfigMode_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:35:49
notes:
DEFERRED: requires leafnode auth callout integration runtime (multi-server handshake and live auth service)


name: TestLeafTLSWindowsCertStore
go_file: server/certstore_windows_test.go
go_method: TestLeafTLSWindowsCertStore
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: CertificateStoreWindowsTests
dotnet_method: LeafTLSWindowsCertStore_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestLeafTLSWindowsCertStore tests the topology of two NATS Servers connected as leaf and hub with authentication of
leaf to hub via mTLS with leaf's certificate and signing key provisioned in the Windows certificate store.


name: TestServerTLSWindowsCertStore
go_file: server/certstore_windows_test.go
go_method: TestServerTLSWindowsCertStore
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: CertificateStoreWindowsTests
dotnet_method: ServerTLSWindowsCertStore_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestServerTLSWindowsCertStore tests the topology of a NATS server requiring TLS and gettings it own server
cert identity (as used when accepting NATS client connections and negotiating TLS) from Windows certificate store.


name: TestServerIgnoreExpiredCerts
go_file: server/certstore_windows_test.go
go_method: TestServerIgnoreExpiredCerts
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: CertificateStoreWindowsTests
dotnet_method: ServerIgnoreExpiredCerts_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestServerIgnoreExpiredCerts tests if the server skips expired certificates in configuration, and finds non-expired ones


name: TestClientHeaderSupport
go_file: server/client_test.go
go_method: TestClientHeaderSupport
status: n_a
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ClientConnectionTests
dotnet_method: ClientHeaderSupport_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test specifically is not testing how headers are encoded in a raw msg.
It wants to make sure the serve and clients agreement on when to use headers
is bi-directional and functions properly.


name: TestClientOutboundQueueCoalesce
go_file: server/client_test.go
go_method: TestClientOutboundQueueCoalesce
status: n_a
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ClientConnectionTests
dotnet_method: ClientOutboundQueueCoalesce_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test ensures that coalescing into the fixed-size output
queues works as expected. When bytes are queued up, they should
not overflow a buffer until the capacity is exceeded, at which
point a new buffer should be added.


name: TestFileStoreStoreLimitRemovePerf
go_file: server/filestore_test.go
go_method: TestFileStoreStoreLimitRemovePerf
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreStoreLimitRemovePerf_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test is testing an upper level stream with a message or byte limit.
Even though this is 1, any limit would trigger same behavior once the limit was reached
and we were adding and removing.


name: TestFileStoreStreamDeleteDirNotEmpty
go_file: server/filestore_test.go
go_method: TestFileStoreStreamDeleteDirNotEmpty
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreStreamDeleteDirNotEmpty_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 18:38:20
description:
We have reports that sometimes under load a stream could complain about a storage directory
not being empty.


name: TestFileStoreBadConsumerState
go_file: server/filestore_test.go
go_method: TestFileStoreBadConsumerState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreBadConsumerState_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We had a case where a consumer state had a redelivered record that had seq of 0.
This was causing the server to panic.


name: TestFileStorePurgeExKeepOneBug
go_file: server/filestore_test.go
go_method: TestFileStorePurgeExKeepOneBug
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStorePurgeExKeepOneBug_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
When messages span multiple blocks and we want to purge but keep some amount, say 1, we would remove all.
This is because we would not break out of iterator across more message blocks.
Issue #2622


name: TestFileStoreCompactReclaimHeadSpace
go_file: server/filestore_test.go
go_method: TestFileStoreCompactReclaimHeadSpace
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreCompactReclaimHeadSpace_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
For things like raft log when we compact and have a message block that could reclaim > 50% of space for block we want to do that.
https://github.com/nats-io/nats-server/issues/2936


name: TestFileStoreShortIndexWriteBug
go_file: server/filestore_test.go
go_method: TestFileStoreShortIndexWriteBug
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreShortIndexWriteBug_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
When the N.idx file is shorter than the previous write we could fail to recover the idx properly.
For instance, with encryption and an expiring stream that has no messages, when a restart happens the decrypt will fail
since their are extra bytes, and this could lead to a stream sequence reset to zero.

NOTE: We do not use idx files anymore, but keeping test.


name: TestFileStoreEncryptedKeepIndexNeedBekResetBug
go_file: server/filestore_test.go
go_method: TestFileStoreEncryptedKeepIndexNeedBekResetBug
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreEncryptedKeepIndexNeedBekResetBug_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
When we kept the empty block for tracking sequence, we needed to reset the bek
counter when encrypted for subsequent writes to be correct. The bek in place could
possibly still have a non-zero counter from previous writes.
Happens when all messages expire and the are flushed and then subsequent writes occur.


name: TestFileStoreRecalcFirstSequenceBug
go_file: server/filestore_test.go
go_method: TestFileStoreRecalcFirstSequenceBug
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreRecalcFirstSequenceBug_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
https://github.com/nats-io/nats-server/issues/4529
Run this wuth --race and you will see the unlocked access that probably caused this.


name: TestFileStoreFullStateMidBlockPastWAL
go_file: server/filestore_test.go
go_method: TestFileStoreFullStateMidBlockPastWAL
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreFullStateMidBlockPastWAL_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This tests we can successfully recover without having to rebuild the whole stream from a mid block index.db marker
when the updated block has a removed entry.
Make sure this does not cause a recover of the full state.


name: TestFileStoreNumPendingLastBySubject
go_file: server/filestore_test.go
go_method: TestFileStoreNumPendingLastBySubject
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreNumPendingLastBySubject_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Since 2.10 we no longer have fss, and the approach for calculating NumPending would branch
based on the old fss metadata being present. This meant that calculating NumPending in >= 2.10.x
would load all blocks to complete. This test makes sure we do not do that anymore.


name: TestFileStoreCorruptPSIMOnDisk
go_file: server/filestore_test.go
go_method: TestFileStoreCorruptPSIMOnDisk
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreCorruptPSIMOnDisk_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We had a bug that could cause internal memory corruption of the psim keys in memory
which could have been written to disk via index.db.


name: TestFileStoreMsgBlockFirstAndLastSeqCorrupt
go_file: server/filestore_test.go
go_method: TestFileStoreMsgBlockFirstAndLastSeqCorrupt
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreMsgBlockFirstAndLastSeqCorrupt_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
https://github.com/nats-io/nats-server/issues/5236
Unclear how the sequences get off here, this is just forcing the situation reported.


name: TestFileStoreDmapBlockRecoverAfterCompact
go_file: server/filestore_test.go
go_method: TestFileStoreDmapBlockRecoverAfterCompact
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamFileStoreTests
dotnet_method: FileStoreDmapBlockRecoverAfterCompact_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test is for deleted interior message tracking after compaction from limits based deletes, meaning no tombstones.
Bug was that dmap would not be properly be hydrated after the compact from rebuild. But we did so in populateGlobalInfo.
So this is just to fix a bug in rebuildState tracking gaps after a compact.


name: TestGatewaySendReplyAcrossGateways
go_file: server/gateway_test.go
go_method: TestGatewaySendReplyAcrossGateways
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: GatewayHandlerTests
dotnet_method: GatewaySendReplyAcrossGateways_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:44:31
description:
This test uses a single account and makes sure that when
a reply subject is prefixed with $GR it comes back to
the origin cluster and delivered to proper reply subject
there, but also to subscribers on that reply subject
on the other cluster.


name: TestGatewayPingPongReplyAcrossGateways
go_file: server/gateway_test.go
go_method: TestGatewayPingPongReplyAcrossGateways
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: GatewayHandlerTests
dotnet_method: GatewayPingPongReplyAcrossGateways_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:44:31
description:
This test will have a requestor on cluster A and responder
on cluster B, but when the responder sends the response,
it will also have a reply subject to receive a response
for the response.


name: TestJetStreamAtomicBatchPublishProposeOne
go_file: server/jetstream_batching_test.go
go_method: TestJetStreamAtomicBatchPublishProposeOne
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamBatchingTests
dotnet_method: JetStreamAtomicBatchPublishProposeOne_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test a batch within a single proposal, optionally combined with messages unrelated
to the batch but within the same proposal.


name: TestJetStreamAtomicBatchPublishProposeMultiple
go_file: server/jetstream_batching_test.go
go_method: TestJetStreamAtomicBatchPublishProposeMultiple
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamBatchingTests
dotnet_method: JetStreamAtomicBatchPublishProposeMultiple_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test a batch spanning multiple proposals, optionally combined with messages unrelated
to the batch but within the same first/last proposal.


name: TestJetStreamAtomicBatchPublishContinuousBatchesStillMoveAppliedUp
go_file: server/jetstream_batching_test.go
go_method: TestJetStreamAtomicBatchPublishContinuousBatchesStillMoveAppliedUp
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamBatchingTests
dotnet_method: JetStreamAtomicBatchPublishContinuousBatchesStillMoveAppliedUp_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test a continuous flow of batches spanning multiple append entries can still move applied up.
Also, test a server can become leader if the previous leader left it with a partial batch.


name: TestJetStreamAtomicBatchPublishPartiallyAppliedBatchOnRecovery
go_file: server/jetstream_batching_test.go
go_method: TestJetStreamAtomicBatchPublishPartiallyAppliedBatchOnRecovery
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamBatchingTests
dotnet_method: JetStreamAtomicBatchPublishPartiallyAppliedBatchOnRecovery_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test a batch that's committed but only partially applied, and the server gets hard killed.
Upon recovery the server should skip the messages that were already applied but store the
messages that weren't applied yet.


name: BenchmarkJetStreamConsumeFilteredContiguous
go_file: server/jetstream_benchmark_test.go
go_method: BenchmarkJetStreamConsumeFilteredContiguous
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamBenchmarks
dotnet_method: BenchmarkJetStreamConsumeFilteredContiguous
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
BenchmarkJetStreamConsumeFilteredContiguous verifies the fix in
https://github.com/nats-io/nats-server/pull/7015 and should
capture future regressions.


name: TestJetStreamClusterQueueSubConsumer
go_file: server/jetstream_cluster_1_test.go
go_method: TestJetStreamClusterQueueSubConsumer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests1
dotnet_method: JetStreamClusterQueueSubConsumer_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test creates a queue consumer for the delivery subject,
and make sure it connects to the server that is not the leader
of the stream. A bug was not stripping the $JS.ACK reply subject
correctly, which means that ack sent on the reply subject was
dropped by the route.


name: TestJetStreamClusterConsumerAckSyncReporting
go_file: server/jetstream_cluster_1_test.go
go_method: TestJetStreamClusterConsumerAckSyncReporting
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests1
dotnet_method: JetStreamClusterConsumerAckSyncReporting_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is to test follower ack fill logic when pending not empty.
There was a bug that would update p.Sequence in the stores (mem & file)
that would cause the logic to fail. Redeliveries were required to trigger.


name: TestJetStreamClusterConsumerAckOutOfBounds
go_file: server/jetstream_cluster_1_test.go
go_method: TestJetStreamClusterConsumerAckOutOfBounds
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests1
dotnet_method: JetStreamClusterConsumerAckOutOfBounds_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Make sure if we received acks that are out of bounds, meaning past our
last sequence or before our first that they are ignored and errored if applicable.


name: TestJetStreamClusterAccountStatsForReplicatedStreams
go_file: server/jetstream_cluster_1_test.go
go_method: TestJetStreamClusterAccountStatsForReplicatedStreams
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests1
dotnet_method: JetStreamClusterAccountStatsForReplicatedStreams_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is for when we are still using $SYS for NRG replication but we want to make sure
we track this in something visible to the end user.


name: TestJetStreamClusterSingleLeafNodeEnablingJetStream
go_file: server/jetstream_cluster_2_test.go
go_method: TestJetStreamClusterSingleLeafNodeEnablingJetStream
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests2
dotnet_method: JetStreamClusterSingleLeafNodeEnablingJetStream_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
When a leafnode enables JS on an account that is not enabled on the remote cluster account this should fail
Accessing a jet stream in a different availability domain requires the client provide a damain name, or
the server having set up appropriate defaults (default_js_domain. tested in leafnode_test.go)


name: TestJetStreamClusterDuplicateRoutesDisruptJetStreamMetaGroup
go_file: server/jetstream_cluster_2_test.go
go_method: TestJetStreamClusterDuplicateRoutesDisruptJetStreamMetaGroup
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests2
dotnet_method: JetStreamClusterDuplicateRoutesDisruptJetStreamMetaGroup_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
If the config files have duplicate routes this can have the metagroup estimate a size for the system
which prevents reaching quorum and electing a meta-leader.


name: TestJetStreamClusterMemoryConsumerCompactVsSnapshot
go_file: server/jetstream_cluster_2_test.go
go_method: TestJetStreamClusterMemoryConsumerCompactVsSnapshot
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests2
dotnet_method: JetStreamClusterMemoryConsumerCompactVsSnapshot_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We were compacting to keep the raft log manageable but not snapshotting, which meant that restarted
servers could complain about no snapshot and could not sync after that condition.
Changes also address https://github.com/nats-io/nats-server/issues/2936


name: TestJetStreamClusterHAssetsEnforcement
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterHAssetsEnforcement
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterHAssetsEnforcement_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We noticed that ha_assets enforcement seemed to not be upheld when assets created in a rapid fashion.


name: TestJetStreamClusterParallelStreamCreationDupeRaftGroups
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterParallelStreamCreationDupeRaftGroups
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterParallelStreamCreationDupeRaftGroups_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
In addition to test above, if streams were attempted to be created in parallel
it could be that multiple raft groups would be created for the same asset.


name: TestJetStreamClusterDirectGetStreamUpgrade
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterDirectGetStreamUpgrade
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterDirectGetStreamUpgrade_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Reported by a customer manually upgrading their streams to support direct gets.
Worked if single replica but not in clustered mode.


name: TestJetStreamClusterInterestPolicyStreamForConsumersToMatchRFactor
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterInterestPolicyStreamForConsumersToMatchRFactor
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterInterestPolicyStreamForConsumersToMatchRFactor_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
For interest (or workqueue) based streams its important to match the replication factor.
This was the case but now that more control over consumer creation is allowed its possible
to create a consumer where the replication factor does not match. This could cause
instability in the state between servers and cause problems on leader switches.


name: TestJetStreamClusterCurrentVsHealth
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterCurrentVsHealth
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterCurrentVsHealth_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestJetStreamClusterCurrentVsHealth is designed to show the
difference between "current" and "healthy" when async publishes
outpace the rate at which they can be applied.


name: TestJetStreamClusterActiveActiveSourcedStreams
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterActiveActiveSourcedStreams
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterActiveActiveSourcedStreams_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Several users and customers use this setup, but many times across leafnodes.
This should be allowed in same account since we are really protecting against
multiple pub acks with cycle detection.


name: TestJetStreamClusterWALBuildupOnNoOpPull
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterWALBuildupOnNoOpPull
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterWALBuildupOnNoOpPull_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestJetStreamClusterWALBuildupOnNoOpPull tests whether or not the consumer
RAFT log is being compacted when the stream is idle but we are performing
lots of fetches. Otherwise the disk usage just spirals out of control if
there are no other state changes to trigger a compaction.


name: TestJetStreamClusterStreamMaxAgeScaleUp
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterStreamMaxAgeScaleUp
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterStreamMaxAgeScaleUp_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Found in https://github.com/nats-io/nats-server/issues/3848
When Max Age was specified and stream was scaled up, new replicas
were expiring messages much later than the leader.


name: TestJetStreamClusterConsumerAckFloorDrift
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterConsumerAckFloorDrift
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterConsumerAckFloorDrift_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
If a consumer has not been registered (possible in heavily loaded systems with lots of assets)
it could miss the signal of a message going away. If that message was pending and expires the
ack floor could fall below the stream first sequence. This test will force that condition and
make sure the system resolves itself.


name: TestJetStreamClusterConsumerInfoForJszForFollowers
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterConsumerInfoForJszForFollowers
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterConsumerInfoForJszForFollowers_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
The consumer info() call does not take into account whether a consumer
is a leader or not, so results would be very different when asking servers
that housed consumer followers vs leaders.


name: TestJetStreamClusterStreamScaleUpNoGroupCluster
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterStreamScaleUpNoGroupCluster
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterStreamScaleUpNoGroupCluster_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Some older streams seem to have been created or exist with no explicit cluster setting.
For server <= 2.9.16 you could not scale the streams up since we could not place them in another cluster.


name: TestJetStreamClusterLeafnodePlusDaisyChainSetup
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterLeafnodePlusDaisyChainSetup
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterTests3
dotnet_method: JetStreamClusterLeafnodePlusDaisyChainSetup_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test mimics a user's setup where there is a cloud cluster/domain, and one for eu and ap that are leafnoded into the
cloud cluster, and one for cn that is leafnoded into the ap cluster.
We broke basic connectivity in 2.9.17 from publishing in eu for delivery in cn on same account which is daisy chained through ap.
We will also test cross account delivery in this test as well.


name: TestLongKVPutWithServerRestarts
go_file: server/jetstream_cluster_long_test.go
go_method: TestLongKVPutWithServerRestarts
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterLongTests
dotnet_method: LongKVPutWithServerRestarts_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestLongKVPutWithServerRestarts overwrites values in a replicated KV bucket for a fixed amount of time.
Also restarts a random server at fixed interval.
The test fails if updates fail for a continuous interval of time, or if a server fails to restart and catch up.


name: TestLongNRGChainOfBlocks
go_file: server/jetstream_cluster_long_test.go
go_method: TestLongNRGChainOfBlocks
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamClusterLongTests
dotnet_method: LongNRGChainOfBlocks_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is a RaftChainOfBlocks test that randomly starts and stops nodes to exercise recovery and snapshots.


name: TestJetStreamConsumerUnpinNoMessages
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerUnpinNoMessages
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NatsConsumerTests
dotnet_method: JetStreamConsumerUnpinNoMessages_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This tests if Unpin works correctly when there are no pending messages.
It checks if the next pinned client will be different than the first one
after new messages is published.


name: TestJetStreamConsumerUnpinPickDifferentRequest
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerUnpinPickDifferentRequest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NatsConsumerTests
dotnet_method: JetStreamConsumerUnpinPickDifferentRequest_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
In some scenarios, if the next waiting request is the same as the old pinned, it could be picked as a new pin.
This test replicates that behavior and checks if the new pin is different than the old one.


name: TestJetStreamConsumerFilterSubject
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerFilterSubject
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NatsConsumerTests
dotnet_method: JetStreamConsumerFilterSubject_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test is in support fo clients that want to match on subject, they
can set the filter subject always. We always store the subject so that
should the stream later be edited to expand into more subjects the consumer
still gets what was actually requested


name: TestJetStreamConsumerCleanupWithRetentionPolicy
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerCleanupWithRetentionPolicy
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NatsConsumerTests
dotnet_method: JetStreamConsumerCleanupWithRetentionPolicy_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We had a report of a consumer delete crashing the server when in interest retention mode.
This I believe is only really possible in clustered mode, but we will force the issue here.


name: TestJetStreamConsumerPullConsumerFIFO
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerPullConsumerFIFO
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NatsConsumerTests
dotnet_method: JetStreamConsumerPullConsumerFIFO_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:08:35
description:
Originally pull consumers were FIFO with respect to the request, not delivery of messages.
We have changed to have the behavior be FIFO but on an individual message basis.
So after a message is delivered, the request, if still outstanding, effectively
goes to the end of the queue of requests pending.


name: TestJetStreamConsumerPullCrossAccountsAndLeafNodes
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerPullCrossAccountsAndLeafNodes
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NatsConsumerTests
dotnet_method: JetStreamConsumerPullCrossAccountsAndLeafNodes_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:08:36
description:
This tests account export/import replies across a LN connection with account import/export
on both sides of the LN.


name: TestJetStreamConsumerPullOneShotBehavior
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerPullOneShotBehavior
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NatsConsumerTests
dotnet_method: JetStreamConsumerPullOneShotBehavior_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:08:36
description:
This test is to explicitly test for all combinations of pull consumer behavior.
 1. Long poll, will be used to emulate push. A request is only invalidated when batch is filled, it expires, or we lose interest.
 2. Batch 1, will return no messages or a message. Works today.
 3. Conditional wait, or one shot. This is what the clients do when the do a fetch().
    They expect to wait up to a given time for any messages but will return once they have any to deliver, so parital fills.
 4. Try, which never waits at all ever.


name: TestJetStreamLeafNodeAndMirrorResyncAfterConnectionDown
go_file: server/jetstream_leafnode_test.go
go_method: TestJetStreamLeafNodeAndMirrorResyncAfterConnectionDown
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamLeafNodeTests
dotnet_method: JetStreamLeafNodeAndMirrorResyncAfterConnectionDown_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This will test that when a mirror or source construct is setup across a leafnode/domain
that it will recover quickly once the LN is re-established regardless
of backoff state of the internal consumer create.


name: TestJetStreamLeafNodeAndMirrorResyncAfterLeafEstablished
go_file: server/jetstream_leafnode_test.go
go_method: TestJetStreamLeafNodeAndMirrorResyncAfterLeafEstablished
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamLeafNodeTests
dotnet_method: JetStreamLeafNodeAndMirrorResyncAfterLeafEstablished_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:05:37
description:
This test will test a 3 node setup where we have a hub node, a gateway node, and a satellite node.
This is specifically testing re-sync when there is not a direct Domain with JS match for the first
hop connect LN that is signaling.

		  HUB <---- GW(+JS/DOMAIN) -----> SAT1
		   ^
		   |
	       +------- GW(-JS/NO DOMAIN) --> SAT2

The Gateway node will solicit the satellites but will act as a LN hub.


name: TestStreamSourcingScalingSourcingManyBenchmark
go_file: server/jetstream_sourcing_scaling_test.go
go_method: TestStreamSourcingScalingSourcingManyBenchmark
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamSourcingScalingTests
dotnet_method: StreamSourcingScalingSourcingManyBenchmark_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test is being skipped by CI as it takes too long to run and is meant to test the scalability of sourcing
rather than being a unit test.


name: TestJetStreamSuperClusterCrossClusterConsumerInterest
go_file: server/jetstream_super_cluster_test.go
go_method: TestJetStreamSuperClusterCrossClusterConsumerInterest
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamSuperClusterTests
dotnet_method: JetStreamSuperClusterCrossClusterConsumerInterest_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test that consumer interest across gateways and superclusters is properly identitifed in a remote cluster.


name: TestJetStreamSuperClusterGetNextRewrite
go_file: server/jetstream_super_cluster_test.go
go_method: TestJetStreamSuperClusterGetNextRewrite
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamSuperClusterTests
dotnet_method: JetStreamSuperClusterGetNextRewrite_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Issue reported with superclusters and leafnodes where first few get next requests for pull subscribers
have the wrong subject.


name: TestJetStreamSuperClusterStateOnRestartPreventsConsumerRecovery
go_file: server/jetstream_super_cluster_test.go
go_method: TestJetStreamSuperClusterStateOnRestartPreventsConsumerRecovery
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamSuperClusterTests
dotnet_method: JetStreamSuperClusterStateOnRestartPreventsConsumerRecovery_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We had a scenario where a consumer would not recover properly on restart due to
the cluster state not being set properly when checking source subjects.


name: TestJetStreamRedeliverAndLateAck
go_file: server/jetstream_test.go
go_method: TestJetStreamRedeliverAndLateAck
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamRedeliverAndLateAck_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We want to make sure that for pull based consumers that if we ack
late with no interest the redelivery attempt is removed and we do
not get the message back.


name: TestJetStreamSingleInstanceRemoteAccess
go_file: server/jetstream_test.go
go_method: TestJetStreamSingleInstanceRemoteAccess
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamSingleInstanceRemoteAccess_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This will be testing our ability to conditionally rewrite subjects for last mile
when working with JetStream. Consumers receive messages that have their subjects
rewritten to match the original subject. NATS routing is all subject based except
for the last mile to the client.


name: TestJetStreamStoreDirectoryFix
go_file: server/jetstream_test.go
go_method: TestJetStreamStoreDirectoryFix
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamStoreDirectoryFix_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:13:28
description:
From 2.2.2 to 2.2.3 we fixed a bug that would not consistently place a jetstream directory
under the store directory configured. However there were some cases where the directory was
created that way and therefore 2.2.3 would start and not recognize the existing accounts,
streams and consumers.


name: TestJetStreamAccountImportBasics
go_file: server/jetstream_test.go
go_method: TestJetStreamAccountImportBasics
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamAccountImportBasics_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is for the basics of importing the ability to send to a stream and consume
from a consumer that is pull based on push based on a well known delivery subject.


name: TestJetStreamAccountImportJSAdvisoriesAsService
go_file: server/jetstream_test.go
go_method: TestJetStreamAccountImportJSAdvisoriesAsService
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamAccountImportJSAdvisoriesAsService_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:13:28
description:
This tests whether we are able to aggregate all JetStream advisory events
from all accounts into a single account. Config for this test uses
service imports and exports as that allows for gathering all events
without having to know the account name and without separate entries
for each account in aggregate account config.
This test fails as it is not receiving the api audit event ($JS.EVENT.ADVISORY.API).


name: TestJetStreamAccountImportJSAdvisoriesAsStream
go_file: server/jetstream_test.go
go_method: TestJetStreamAccountImportJSAdvisoriesAsStream
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamAccountImportJSAdvisoriesAsStream_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:13:28
description:
This tests whether we are able to aggregate all JetStream advisory events
from all accounts into a single account. Config for this test uses
stream imports and exports as that allows for gathering all events
as long as there is a separate stream import entry for each account
in aggregate account config.


name: TestJetStreamExpireAllWhileServerDown
go_file: server/jetstream_test.go
go_method: TestJetStreamExpireAllWhileServerDown
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamExpireAllWhileServerDown_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Got a report of streams that expire all messages while the server is down report errors when clients reconnect
and try to send new messages.


name: TestJetStreamMaxMsgsPerSubjectWithDiscardNew
go_file: server/jetstream_test.go
go_method: TestJetStreamMaxMsgsPerSubjectWithDiscardNew
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamMaxMsgsPerSubjectWithDiscardNew_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test that we properly enforce per subject msg limits when DiscardNew is set.
DiscardNew should only apply to stream limits, subject based limits should always be DiscardOld.


name: TestJetStreamFlowControlStall
go_file: server/jetstream_test.go
go_method: TestJetStreamFlowControlStall
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamFlowControlStall_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:13:30
description:
Under load testing for K3S and the KINE interface we saw some stalls.
These were caused by a dynamic that would not send a second FC item with one
pending, but when we sent the next message and got blocked, if that msg would
exceed the outstanding FC we would become stalled.


name: TestJetStreamDirectMsgGetNext
go_file: server/jetstream_test.go
go_method: TestJetStreamDirectMsgGetNext
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamDirectMsgGetNext_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This allows support for a get next given a sequence as a starting.
This allows these to be chained together if needed for sparse streams.


name: TestJetStreamKVReductionInHistory
go_file: server/jetstream_test.go
go_method: TestJetStreamKVReductionInHistory
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamKVReductionInHistory_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:13:31
description:
Make sure when we downgrade history to a smaller number that the account info
is properly updated and all keys are still accessible.
There was a bug calculating next first that was not taking into account the dbit slots.


name: TestJetStreamFlowControlCrossAccountFanOut
go_file: server/jetstream_test.go
go_method: TestJetStreamFlowControlCrossAccountFanOut
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamEngineTests
dotnet_method: JetStreamFlowControlCrossAccountFanOut_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test that flow control works correctly when a stream sources from two
different external accounts. Each account's $JS.FC.> service import
causes FC replies to fan out to all accounts, but only the correct
account's consumer handles the reply. This verifies the fan-out
doesn't prevent FC from completing.


name: TestJetStreamTPMKeyBadPassword
go_file: server/jetstream_tpm_test.go
go_method: TestJetStreamTPMKeyBadPassword
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamTpmTests
dotnet_method: JetStreamTPMKeyBadPassword_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:04:58
description:
Warning: Running this test too frequently will considerably slow down
these tests and eventually lock out the TPM.

Depending on the environment this varies from 10 failures per day with
a 24 hour lockout (Dell) to 32 failures per day with a 10
minute healing time (decrementing one failure every 10 minutes).


name: TestJWTAccountServiceImportAuthSwitch
go_file: server/jwt_test.go
go_method: TestJWTAccountServiceImportAuthSwitch
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JwtProcessorTests
dotnet_method: JWTAccountServiceImportAuthSwitch_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This will test that we can switch from a public export to a private
one and back with export claims to make sure the claim update mechanism
is working properly.


name: TestJWTAccountLimitsMaxConnsAfterExpired
go_file: server/jwt_test.go
go_method: TestJWTAccountLimitsMaxConnsAfterExpired
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JwtProcessorTests
dotnet_method: JWTAccountLimitsMaxConnsAfterExpired_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test ensures that connected clients are properly evicted
(no deadlock) if the max conns of an account has been lowered
and the account is being updated (following expiration during
a lookup).


name: TestLeafNodeHttpProxyValidationProgrammatic
go_file: server/leafnode_proxy_test.go
go_method: TestLeafNodeHttpProxyValidationProgrammatic
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: LeafNodeProxyTests
dotnet_method: LeafNodeHttpProxyValidationProgrammatic_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestLeafNodeProxyValidationProgrammatic tests proxy validation when configuring server programmatically


name: TestLeafNodeBasicAuthFailover
go_file: server/leafnode_test.go
go_method: TestLeafNodeBasicAuthFailover
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: LeafNodeHandlerTests
dotnet_method: LeafNodeBasicAuthFailover_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:09:26
description:
This test ensures that we can connect using proper user/password
to a LN URL that was discovered through the INFO protocol.
We also check that the password doesn't leak to debug/trace logs.


name: TestLeafNodeLoopDetectedOnAcceptSide
go_file: server/leafnode_test.go
go_method: TestLeafNodeLoopDetectedOnAcceptSide
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: LeafNodeHandlerTests
dotnet_method: LeafNodeLoopDetectedOnAcceptSide_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:47:31
description:
Make sure that if the node that detects the loop (and sends the error and
close the connection) is the accept side, the remote node (the one that solicits)
properly use the reconnect delay.


name: TestLeafNodeLoopDetectedDueToReconnect
go_file: server/leafnode_test.go
go_method: TestLeafNodeLoopDetectedDueToReconnect
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: LeafNodeHandlerTests
dotnet_method: LeafNodeLoopDetectedDueToReconnect_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test will simulate that the accept side does not detect the connection
has been closed early enough. The soliciting side will attempt to reconnect
and we should not be getting the "loop detected" error.


name: TestLeafNodeWSNoBufferCorruption
go_file: server/leafnode_test.go
go_method: TestLeafNodeWSNoBufferCorruption
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: LeafNodeHandlerTests
dotnet_method: LeafNodeWSNoBufferCorruption_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:47:31
description:
This test was showing an issue if one set maxBufSize to very small value,
such as maxBufSize = 10. With such small value, we would get a corruption
in that LMSG would arrive with missing bytes. We are now always making
a copy when dealing with messages that are bigger than maxBufSize.


name: Benchmark_MemStoreLoadNextMsgFiltered
go_file: server/memstore_test.go
go_method: Benchmark_MemStoreLoadNextMsgFiltered
status: n_a
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: JetStreamMemoryStoreTests
dotnet_method: Benchmark_MemStoreLoadNextMsgFiltered
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 18:16:27
description:
This benchmark populates a memstore and then measures
the time it takes to load the entire store using
LoadNextMsg repeatedly until the store returns ErrStoreEOF.


name: TestMonitorIpqzWithGenerics
go_file: server/monitor_test.go
go_method: TestMonitorIpqzWithGenerics
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: MonitoringHandlerTests
dotnet_method: MonitorIpqzWithGenerics_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:56:35
description:
When we converted ipq to use generics we still were using sync.Map. Currently you can not convert
any or any to a generic parameterized type. So this stopped working and panics.
Copyright 2013-2024 The NATS Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Make sure that we do not run the http server for monitoring unless asked.
https://github.com/nats-io/nats-server/issues/2170
Just the ever increasing subs part.
Helper to map to connection name
getConnsIdleDurations returns a slice of parsed idle durations from a connection info slice.
sortedDurationsDesc checks if a time.Duration slice is sorted in descending order.
getIdleDurations returns a slice of idle durations from a connection info list up until now time.
sortedDurationsAsc checks if a time.Duration slice is sorted in ascending order.
Tests handle root
Make sure options for ConnInfo like subs=1, authuser, etc do not cause a race.
Make sure a bad client that is disconnected right away has proper values.
Make sure a bad client that tries to connect plain to TLS has proper values.
Create a connection to test ConnInfo
Benchmark our Connz generation. Don't use HTTP here, just measure server endpoint.
Helper function to check that a JS cluster is formed
https://github.com/nats-io/nats-server/issues/4144
createCallbackURL adds a callback query parameter for JSONP requests.
stripCallback removes the JSONP callback function from the response.
Returns the JSON body without the wrapping callback function.
If there's no callback function, the data is returned as is.
expectHealthStatus makes 1 regular and 1 JSONP request to the URL and checks the
HTTP status code, Content-Type header and health status string.
checkHealthStatus checks the health status from a JSON response.
checkHealthzEndpoint makes requests to the /healthz endpoint and checks the health status.
When we converted ipq to use generics we still were using sync.Map. Currently you can not convert
any or any to a generic parameterized type. So this stopped working and panics.


name: TestMQTTQoS2InflightMsgsDeliveredAfterUnsubscribe
go_file: server/mqtt_test.go
go_method: TestMQTTQoS2InflightMsgsDeliveredAfterUnsubscribe
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: MqttHandlerTests
dotnet_method: MQTTQoS2InflightMsgsDeliveredAfterUnsubscribe_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
- [MQTT-3.10.4-3] If a Server deletes a Subscription It MUST complete the
delivery of any QoS 1 or QoS 2 messages which it has started to send to the
Client.

Test flow:
  - Subscribe to foo, publish 3 QoS2 messages.
  - After one is PUBCOMP-ed, and one is PUBREC-ed, Unsubscribe.
  - See that the remaining 2 are fully delivered.


name: TestMQTTConsumerReplicasOverride
go_file: server/mqtt_test.go
go_method: TestMQTTConsumerReplicasOverride
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: MqttHandlerTests
dotnet_method: MQTTConsumerReplicasOverride_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This was ill-advised since the messages stream is currently interest policy.
Interest policy streams require consumers match the replica count.
Will leave her for now to make sure we do not override.


name: TestMQTTSubjectWildcardStart
go_file: server/mqtt_test.go
go_method: TestMQTTSubjectWildcardStart
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: MqttHandlerTests
dotnet_method: MQTTSubjectWildcardStart_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:18:18
description:
Issue https://github.com/nats-io/nats-server/issues/3924
The MQTT Server MUST NOT match Topic Filters starting with a wildcard character (# or +),
with Topic Names beginning with a $ character [MQTT-4.7.2-1]


name: TestServerInfoNonceAlwaysEnabled
go_file: server/nkey_test.go
go_method: TestServerInfoNonceAlwaysEnabled
status: n_a
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NKeyHandlerTests
dotnet_method: ServerInfoNonceAlwaysEnabled_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
notes:
Requires running NATS server helpers (rawSetup/setUpClientWithResponse) — deferred to integration tests in session 09/10


name: TestNoRaceAccountAddServiceImportRace
go_file: server/norace_1_test.go
go_method: TestNoRaceAccountAddServiceImportRace
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceAccountAddServiceImportRace_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This test is same than TestAccountAddServiceImportRace but running
without the -race flag, it would capture more easily the possible
duplicate sid, resulting in less than expected number of subscriptions
in the account's internal subscriptions map.


name: TestNoRaceQueueAutoUnsubscribe
go_file: server/norace_1_test.go
go_method: TestNoRaceQueueAutoUnsubscribe
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceQueueAutoUnsubscribe_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:00:47
description:
Similar to the routed version. Make sure we receive all of the
messages with auto-unsubscribe enabled.


name: TestNoRaceJetStreamServiceImportAccountSwapIssue
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamServiceImportAccountSwapIssue
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamServiceImportAccountSwapIssue_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We used to swap accounts on an inbound message when processing service imports.
Until JetStream this was kinda ok, but with JetStream we can have pull consumers
trying to access the clients account in another Go routine now which causes issues.
This is not limited to the case above, its just the one that exposed it.
This test is to show that issue and that the fix works, meaning we no longer swap c.acc.


name: TestNoRaceJetStreamSlowRestartWithManyExpiredMsgs
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamSlowRestartWithManyExpiredMsgs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamSlowRestartWithManyExpiredMsgs_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Report of slow restart for a server that has many messages that have expired while it was not running.


name: TestNoRaceJetStreamSuperClusterAccountConnz
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamSuperClusterAccountConnz
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamSuperClusterAccountConnz_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We will use JetStream helpers to create supercluster but this test is about exposing the ability to access
account scoped connz with subject interest filtering.


name: TestNoRaceJetStreamOrderedConsumerMissingMsg
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamOrderedConsumerMissingMsg
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamOrderedConsumerMissingMsg_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:00:47
description:
This test was from Ivan K. and showed a bug in the filestore implementation.
This is skipped by default since it takes >40s to run.


name: TestNoRaceJetStreamClusterInterestPolicyAckNone
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterInterestPolicyAckNone
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamClusterInterestPolicyAckNone_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Issue #2488 - Bad accounting, can not reproduce the stalled consumers after last several PRs.
Issue did show bug in ack logic for no-ack and interest based retention.


name: TestNoRaceJetStreamLastSubjSeqAndFilestoreCompact
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamLastSubjSeqAndFilestoreCompact
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamLastSubjSeqAndFilestoreCompact_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
There was a bug in the filestore compact code that would cause a store
with JSExpectedLastSubjSeq to fail with "wrong last sequence: 0"


name: TestNoRaceJetStreamClusterStreamReset
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterStreamReset
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamClusterStreamReset_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Make sure when we try to hard reset a stream state in a cluster that we also re-create the consumers.


name: TestNoRaceJetStreamClusterStreamSeqMismatchIssue
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterStreamSeqMismatchIssue
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamClusterStreamSeqMismatchIssue_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Trying to recreate an issue rip saw with KV and server restarts complaining about
mismatch for a few minutes and growing memory.


name: TestNoRaceJetStreamConsumerFileStoreConcurrentDiskIO
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamConsumerFileStoreConcurrentDiskIO
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamConsumerFileStoreConcurrentDiskIO_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is related to an issue reported where we were exhausting threads by trying to
cleanup too many consumers at the same time.
https://github.com/nats-io/nats-server/issues/2742


name: TestNoRaceJetStreamStreamInfoSubjectDetailsLimits
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamStreamInfoSubjectDetailsLimits
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamStreamInfoSubjectDetailsLimits_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test that we can receive larger messages with stream subject details.
Also test that we will fail at some point and the user can fall back to
an orderedconsumer like we do with watch for KV Keys() call.


name: TestNoRaceJetStreamClusterDirectAccessAllPeersSubs
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterDirectAccessAllPeersSubs
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamClusterDirectAccessAllPeersSubs_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test that all peers have the direct access subs that participate in a queue group,
but only when they are current and ready. So we will start with R1, add in messages
then scale up while also still adding messages.


name: TestNoRaceEncodeConsumerStateBug
go_file: server/norace_1_test.go
go_method: TestNoRaceEncodeConsumerStateBug
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceEncodeConsumerStateBug_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Bug when we encode a timestamp that upon decode causes an error which causes server to panic.
This can happen on consumer redelivery since they adjusted timstamps can be in the future, and result
in a negative encoding. If that encoding was exactly -1 seconds, would cause decodeConsumerState to fail
and the server to panic.


name: TestNoRaceJetStreamClusterConsumerInfoSpeed
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterConsumerInfoSpeed
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamClusterConsumerInfoSpeed_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
ConsumerInfo seems to being called quite a bit more than we had anticipated.
Under certain circumstances, since we reset num pending, this can be very costly.
We will use the fast path to alleviate that performance bottleneck but also make
sure we are still being accurate.


name: TestNoRaceJetStreamConsumerCreateTimeNumPending
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamConsumerCreateTimeNumPending
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamConsumerCreateTimeNumPending_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:00:47
description:
Test for consumer create when the subject cardinality is high and the
consumer is filtered with a wildcard that forces linear scans.
We have an optimization to use in memory structures in filestore to speed up.
Only if asking to scan all (DeliverAll).


name: TestNoRaceJetStreamClusterF3Setup
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterF3Setup
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamClusterF3Setup_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is to test a publish slowdown and general instability experienced in a setup similar to this.
We have feeder streams that are all sourced to an aggregate stream. All streams are interest retention.
We want to monitor the avg publish time for the sync publishers to the feeder streams, the ingest rate to
the aggregate stream, and general health of the consumers on the aggregate stream.
Target publish rate is ~2k/s with publish time being ~40-60ms but remaining stable.
We can also simulate max redeliveries that create interior deletes in streams.


name: TestNoRaceJetStreamClusterDifferentRTTInterestBasedStreamSetup
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterDifferentRTTInterestBasedStreamSetup
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceJetStreamClusterDifferentRTTInterestBasedStreamSetup_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
We test an interest based stream that has a cluster with a node with asymmetric paths from
the stream leader and the consumer leader such that the consumer leader path is fast and
replicated acks arrive sooner then the actual message. This path was considered, but also
categorized as very rare and was expensive as it tried to forward a new stream msg delete
proposal to the original stream leader. It now will deal with the issue locally and not
slow down the ingest rate to the stream's publishers.


name: TestNoRaceRoutePoolAndPerAccountConfigReload
go_file: server/norace_1_test.go
go_method: TestNoRaceRoutePoolAndPerAccountConfigReload
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceRoutePoolAndPerAccountConfigReload_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:12:49
description:
This test, which checks that messages are not duplicated when pooling or
per-account routes are reloaded, would cause a DATA RACE that is not
specific to the changes for pooling/per_account. For this reason, this
test is located in the norace_test.go file.


name: TestNoRaceClientOutboundQueueMemory
go_file: server/norace_1_test.go
go_method: TestNoRaceClientOutboundQueueMemory
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests1
dotnet_method: NoRaceClientOutboundQueueMemory_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 10:00:47
description:
This test ensures that outbound queues don't cause a run on
memory when sending something to lots of clients.


name: TestNoRaceLargeStreamCatchups
go_file: server/norace_2_test.go
go_method: TestNoRaceLargeStreamCatchups
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests2
dotnet_method: NoRaceLargeStreamCatchups_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
When a catchup takes a long time and the ingest rate is high enough to cause us
to drop append entries and move our first past out catchup window due to max bytes or max msgs, etc.


name: TestNoRaceFileStoreMsgLimitsAndOldRecoverState
go_file: server/norace_2_test.go
go_method: TestNoRaceFileStoreMsgLimitsAndOldRecoverState
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConcurrencyTests2
dotnet_method: NoRaceFileStoreMsgLimitsAndOldRecoverState_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Under certain scenarios an old index.db with a stream that has msg limits set will not restore properly
due to an old index.db and compaction after the index.db took place which could lose per subject information.


name: TestAuthorizationConfig
go_file: server/opts_test.go
go_method: TestAuthorizationConfig
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ServerOptionsTests
dotnet_method: AuthorizationConfig_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 16:17:28
description:
Test highly depends on contents of the config file listed below. Any changes to that file
may very well break this test.


name: TestProcessConfigString
go_file: server/opts_test.go
go_method: TestProcessConfigString
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ServerOptionsTests
dotnet_method: ProcessConfigString_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestProcessConfigString duplicates the previous test, but uses the (*Options).ProcessConfigString
instead of the ProcessConfigFile function.


name: TestNewServerFromConfigFunctionality
go_file: server/opts_test.go
go_method: TestNewServerFromConfigFunctionality
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ServerOptionsTests
dotnet_method: NewServerFromConfigFunctionality_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestNewServerFromConfigFunctionality tests the NewServerFromConfig() function
to ensure it properly processes config files and creates servers correctly.


name: TestNewServerFromConfigVsLoadConfig
go_file: server/opts_test.go
go_method: TestNewServerFromConfigVsLoadConfig
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ServerOptionsTests
dotnet_method: NewServerFromConfigVsLoadConfig_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 09:37:29
description:
TestNewServerFromConfigVsLoadConfig tests that NewServerFromConfig produces
equivalent results to the traditional LoadConfig approach.


name: TestNRGSimpleElection
go_file: server/raft_test.go
go_method: TestNRGSimpleElection
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: RaftNodeTests
dotnet_method: NRGSimpleElection_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestNRGSimpleElection tests that a simple election succeeds. It is
simple because the group hasn't processed any entries and hasn't
suffered any interruptions of any kind, therefore there should be
no way that the conditions for granting the votes can fail.


name: TestNRGLeaderTransfer
go_file: server/raft_test.go
go_method: TestNRGLeaderTransfer
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: RaftNodeTests
dotnet_method: NRGLeaderTransfer_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestNRGLeaderTransfer verifies that a Raft group correctly transfers
leadership to a chosen preferred node when the current leader steps down.


name: TestNRGChainOfBlocksRunInLockstep
go_file: server/raft_test.go
go_method: TestNRGChainOfBlocksRunInLockstep
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: RaftNodeTests
dotnet_method: NRGChainOfBlocksRunInLockstep_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is a RaftChainOfBlocks test where a block is proposed and then we wait for all replicas to apply it before
proposing the next one.
The test may fail if:
  - Replicas hash diverge
  - One replica never applies the N-th block applied by the rest
  - The given number of blocks cannot be applied within some amount of time


name: TestNRGChainOfBlocksStopAndCatchUp
go_file: server/raft_test.go
go_method: TestNRGChainOfBlocksStopAndCatchUp
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: RaftNodeTests
dotnet_method: NRGChainOfBlocksStopAndCatchUp_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is a RaftChainOfBlocks test where one of the replicas is stopped before proposing a short burst of blocks.
Upon resuming the replica, we check it is able to catch up to the rest.
The test may fail if:
  - Replicas hash diverge
  - One replica never applies the N-th block applied by the rest
  - The given number of blocks cannot be applied within some amount of time


name: TestNRGProposeRemovePeerLeader
go_file: server/raft_test.go
go_method: TestNRGProposeRemovePeerLeader
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: RaftNodeTests
dotnet_method: NRGProposeRemovePeerLeader_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Test outline:
  - In a R3 cluster, PeerRemove the leader and block on of
    the followers.
  - Verify that the membership change can't make progress,
    the leader should not count its own ack towards quorum.
  - Release the previously blocked follower and expect the
    membership change to take place.


name: TestConfigReloadNoConfigFile
go_file: server/reload_test.go
go_method: TestConfigReloadNoConfigFile
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadNoConfigFile_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload returns an error when attempting to reload a server that did
not start with a config file.


name: TestConfigReloadUnsupported
go_file: server/reload_test.go
go_method: TestConfigReloadUnsupported
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadUnsupported_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload returns an error when attempting to change an option which
does not support reloading.


name: TestConfigReloadUnsupportedHotSwapping
go_file: server/reload_test.go
go_method: TestConfigReloadUnsupportedHotSwapping
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadUnsupportedHotSwapping_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This checks that if we change an option that does not support hot-swapping
we get an error. Using `listen` for now (test may need to be updated if
server is changed to support change of listen spec).


name: TestConfigReloadRotateTLS
go_file: server/reload_test.go
go_method: TestConfigReloadRotateTLS
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadRotateTLS_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports TLS config changes. Test this by starting a server
with TLS enabled, connect to it to verify, reload config using a different
key pair and client verification enabled, ensure reconnect fails, then
ensure reconnect succeeds when the client provides a cert.


name: TestConfigReloadEnableTLS
go_file: server/reload_test.go
go_method: TestConfigReloadEnableTLS
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadEnableTLS_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports enabling TLS. Test this by starting a server without
TLS enabled, connect to it to verify, reload config with TLS enabled, ensure
reconnect fails, then ensure reconnect succeeds when using secure.


name: TestConfigReloadDisableTLS
go_file: server/reload_test.go
go_method: TestConfigReloadDisableTLS
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadDisableTLS_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports disabling TLS. Test this by starting a server with
TLS enabled, connect to it to verify, reload config with TLS disabled,
ensure reconnect fails, then ensure reconnect succeeds when connecting
without secure.


name: TestConfigReloadRotateUserAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadRotateUserAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadRotateUserAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports single user authentication config changes. Test this
by starting a server with authentication enabled, connect to it to verify,
reload config using a different username/password, ensure reconnect fails,
then ensure reconnect succeeds when using the correct credentials.


name: TestConfigReloadEnableUserAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadEnableUserAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadEnableUserAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports enabling single user authentication. Test this by
starting a server with authentication disabled, connect to it to verify,
reload config using with a username/password, ensure reconnect fails, then
ensure reconnect succeeds when using the correct credentials.


name: TestConfigReloadDisableUserAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadDisableUserAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadDisableUserAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports disabling single user authentication. Test this by
starting a server with authentication enabled, connect to it to verify,
reload config using with authentication disabled, then ensure connecting
with no credentials succeeds.


name: TestConfigReloadRotateTokenAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadRotateTokenAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadRotateTokenAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports token authentication config changes. Test this by
starting a server with token authentication enabled, connect to it to
verify, reload config using a different token, ensure reconnect fails, then
ensure reconnect succeeds when using the correct token.


name: TestConfigReloadEnableTokenAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadEnableTokenAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadEnableTokenAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports enabling token authentication. Test this by starting
a server with authentication disabled, connect to it to verify, reload
config using with a token, ensure reconnect fails, then ensure reconnect
succeeds when using the correct token.


name: TestConfigReloadDisableTokenAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadDisableTokenAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadDisableTokenAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports disabling single token authentication. Test this by
starting a server with authentication enabled, connect to it to verify,
reload config using with authentication disabled, then ensure connecting
with no token succeeds.


name: TestConfigReloadRotateUsersAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadRotateUsersAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadRotateUsersAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports users authentication config changes. Test this by
starting a server with users authentication enabled, connect to it to
verify, reload config using a different user, ensure reconnect fails, then
ensure reconnect succeeds when using the correct credentials.


name: TestConfigReloadEnableUsersAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadEnableUsersAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadEnableUsersAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports enabling users authentication. Test this by starting
a server with authentication disabled, connect to it to verify, reload
config using with users, ensure reconnect fails, then ensure reconnect
succeeds when using the correct credentials.


name: TestConfigReloadDisableUsersAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadDisableUsersAuthentication
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadDisableUsersAuthentication_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports disabling users authentication. Test this by starting
a server with authentication enabled, connect to it to verify,
reload config using with authentication disabled, then ensure connecting
with no credentials succeeds.


name: TestConfigReloadChangePermissions
go_file: server/reload_test.go
go_method: TestConfigReloadChangePermissions
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadChangePermissions_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports changing permissions. Test this by starting a server
with a user configured with certain permissions, test publish and subscribe,
reload config with new permissions, ensure the previous subscription was
closed and publishes fail, then ensure the new permissions succeed.


name: TestConfigReloadEnableClusterAuthorization
go_file: server/reload_test.go
go_method: TestConfigReloadEnableClusterAuthorization
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadEnableClusterAuthorization_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports enabling route authorization. Test this by starting
two servers in a cluster without authorization, ensuring messages flow
between them, then reloading with authorization and ensuring messages no
longer flow until reloading with the correct credentials.


name: TestConfigReloadDisableClusterAuthorization
go_file: server/reload_test.go
go_method: TestConfigReloadDisableClusterAuthorization
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadDisableClusterAuthorization_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports disabling route authorization. Test this by starting
two servers in a cluster with authorization, ensuring messages flow
between them, then reloading without authorization and ensuring messages
still flow.


name: TestConfigReloadClusterRoutes
go_file: server/reload_test.go
go_method: TestConfigReloadClusterRoutes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadClusterRoutes_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports changing cluster routes. Test this by starting
two servers in a cluster, ensuring messages flow between them, then
reloading with a different route and ensuring messages flow through the new
cluster.


name: TestConfigReloadClusterRemoveSolicitedRoutes
go_file: server/reload_test.go
go_method: TestConfigReloadClusterRemoveSolicitedRoutes
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadClusterRemoveSolicitedRoutes_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports removing a solicited route. In this case from A->B
Test this by starting two servers in a cluster, ensuring messages flow between them.
Then stop server B, and have server A continue to try to connect. Reload A with a config
that removes the route and make sure it does not connect to server B when its restarted.


name: TestConfigReloadMaxConnections
go_file: server/reload_test.go
go_method: TestConfigReloadMaxConnections
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadMaxConnections_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure Reload supports changing the max connections. Test this by starting a
server with no max connections, connecting two clients, reloading with a
max connections of one, and ensuring one client is disconnected.


name: TestConfigReloadMaxPayload
go_file: server/reload_test.go
go_method: TestConfigReloadMaxPayload
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadMaxPayload_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure reload supports changing the max payload size. Test this by starting
a server with the default size limit, ensuring publishes work, reloading
with a restrictive limit, and ensuring publishing an oversized message fails
and disconnects the client.


name: TestConfigReloadRotateFiles
go_file: server/reload_test.go
go_method: TestConfigReloadRotateFiles
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadRotateFiles_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Ensure reload supports rotating out files. Test this by starting
a server with log and pid files, reloading new ones, then check that
we can rename and delete the old log/pid files.


name: TestConfigReloadNotPreventedByGateways
go_file: server/reload_test.go
go_method: TestConfigReloadNotPreventedByGateways
status: deferred
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: ConfigReloaderTests
dotnet_method: ConfigReloadNotPreventedByGateways_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
As of now, config reload does not support changes for gateways.
However, ensure that if a gateway is defined, one can still
do reload as long as we don't change the gateway spec.


name: TestRoutePoolWithOlderServerConnectAndReconnect
go_file: server/routes_test.go
go_method: TestRoutePoolWithOlderServerConnectAndReconnect
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: RouteHandlerTests
dotnet_method: RoutePoolWithOlderServerConnectAndReconnect_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-28 13:05:19
description:
This test will make sure that a server with pooling does not
keep trying to connect to a non pooled (for instance old) server.
Will also make sure that if the old server is simply accepting
connections, and restarted, the server with pooling will connect.


name: TestServerJsonMarshalNestedStructsPanic
go_file: server/server_test.go
go_method: TestServerJsonMarshalNestedStructsPanic
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: NatsServerTests
dotnet_method: ServerJsonMarshalNestedStructsPanic_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This is a test that guards against using goccy/go-json.
At least until it's fully compatible with std encoding/json, and we've thoroughly tested it.
This is just one bug (at the time of writing) that results in a panic.
https://github.com/goccy/go-json/issues/519


name: TestSublistRemoteQueueSubscriptions
go_file: server/sublist_test.go
go_method: TestSublistRemoteQueueSubscriptions
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: SubscriptionIndexTests
dotnet_method: SublistRemoteQueueSubscriptions_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
Remote subscriptions for queue subscribers will be weighted such that a single subscription
is received, but represents all of the queue subscribers on the remote side.


name: TestSubjectTreeInsertLongerLeafSuffixWithTrailingNulls
go_file: server/stree/stree_test.go
go_method: TestSubjectTreeInsertLongerLeafSuffixWithTrailingNulls
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: SubjectTreeTests
dotnet_method: SubjectTreeInsertLongerLeafSuffixWithTrailingNulls_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
This bug requires the trailing suffix contain repeating nulls \x00
and the second subject be longer with more nulls.


name: TestLoadJetStreamEncryptionKeyFromTPMBasic
go_file: server/tpm/js_ek_tpm_test.go
go_method: TestLoadJetStreamEncryptionKeyFromTPMBasic
status: verified
dotnet_project: ZB.MOM.NatsNet.Server.Tests
dotnet_class: TpmKeyProviderTests
dotnet_method: LoadJetStreamEncryptionKeyFromTPMBasic_ShouldSucceed
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-27 15:22:55
description:
TestLoadJetStreamEncryptionKeyFromTPMBasic tests the basic functionality.
The first pass will create the keys and generate the js encryption key.
the second pass will read the keys from disk, decrypt with the TPM (unseal),
and return the same key.


# status_overrides

table_name: features
audit_status: deferred
audit_reason: Class exists but method not found
requested_status: verified
created_at: 2026-02-27 11:11:45
comment:
Implemented in SubjectTransform class instead of SubscriptionIndex — ValidateMapping is a subject transform concern


table_name: features
audit_status: deferred
audit_reason: Class not found in .NET source
requested_status: verified
created_at: 2026-02-27 15:00:54
comment:
Already implemented in MsgScheduling.cs — dotnet_class maps to Scheduler but code is in MsgScheduling


table_name: features
audit_status: deferred
audit_reason: Class exists but method not found
requested_status: verified
created_at: 2026-02-27 15:01:56
comment:
Already implemented — Go error interfaces mapped to .NET Exception types with Message/Is/InnerException


table_name: features
audit_status: deferred
audit_reason: Class exists but method not found
requested_status: verified
created_at: 2026-02-27 15:03:50
comment:
Already implemented — Go newSDMMeta maps to StreamDeletionMeta constructor, Go newClosedRingBuffer maps to ClosedRingBuffer constructor


table_name: unit_tests
audit_status: deferred
audit_reason: Class exists but method not found
requested_status: n_a
created_at: 2026-02-28 12:43:35
comment:
n/a: requires live multi-server route-pool topology/reconnect behavior not representable in current unit-test harness


table_name: features
audit_status: verified
audit_reason: Method found with 7 statement(s) at NatsServer.Logging.cs:32
requested_status: complete
created_at: 2026-02-28 12:56:20
comment:
batch4 task2 evidence complete: build+focused test gates passed; audit auto-classifies methods as verified


table_name: features
audit_status: verified
audit_reason: Method found with 1 statement(s) at NatsServer.Logging.cs:178
requested_status: complete
created_at: 2026-02-28 13:00:06
comment:
batch4 task3 evidence complete: build+focused test gates passed; audit auto-classifies methods as verified


table_name: features
audit_status: verified
audit_reason: Method found with 3 statement(s) at ServerOptions.Methods.cs:448
requested_status: complete
created_at: 2026-02-28 15:52:10
comment:
evidence: F1 build gate + F1 class gate green; applying required intermediate status before verified


table_name: features
audit_status: deferred
audit_reason: Class not found in .NET source
requested_status: verified
created_at: 2026-02-28 16:48:46
comment:
batch8 group A verified via StoreTypesTests + StorageEngine/JetStreamMemoryStore gate pass and no stub markers


table_name: unit_tests
audit_status: stub
audit_reason: Body is throw NotImplementedException at AuthCalloutTests.cs:178
requested_status: deferred
created_at: 2026-02-28 17:37:58
comment:
blocked: requires full auth-callout runtime path (internal request/reply + signed response validation)


