Skip to content

Releases: nats-io/nats.deno

v1.10.2

21 Dec 14:39
d8e555b
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.10.1...v1.10.2

v1.10.1

20 Dec 18:43
ba6863b
Compare
Choose a tag to compare

What's Changed

  • [CHANGE] [SRV] name and id are now case-sensitive @aricart in #441
  • [TEST] [SRV] custom assert messages were not used by @aricart in #440
  • [BUMP] client version to 1.10.1 and nats-server for CI to 2.9.10 by @aricart in #442

Full Changelog: v1.10.0...v1.10.1

v1.10.0

19 Dec 18:32
Compare
Choose a tag to compare

What's Changed

The most notable change is the introduction of the NATS service API that makes it even easier to implement services using NATS.

  • [FIX] [JS] publish with expect.lastSequence or expect.lastSubjectSequence set to 0 was not honored by @aricart in #433
  • [FEAT] [SERVICE] service framework by @aricart in #383
  • [FEAT] [CORE] added option to customize the jitter setting in RequestMany by @aricart in #405
  • [FIX] [CORE] remove remembering of permissions error by @aricart in #406
  • [CHANGE] [CORE] subscriptions that get a permissions error are now discarded and won't automatically resub in case of a disconnect @aricart in #408
  • [FIX] [CORE] properly resolve the close promise when close() in a disconnected state by @aricart in #415
  • [BUMP] Deno to 1.29.1 and std to 0.168.0 by @aricart in #434
  • [DOCS] update by @aricart in #435

Deno Specific Changes

[FIX] Deno 1.29.1 revealed a Conn leak when the client failed to connect due to an exception. #423

Full Changelog: v1.9.3...v1.10.0

v1.9.3

01 Dec 20:23
12ac9a4
Compare
Choose a tag to compare

What's Changed

  • [FIX] protocol errors shouldn't close() the client by @aricart in #422
  • [internal] pushing a function to a queued iterator that sets an error is ignored until the next yield by @aricart in #420

Full Changelog: v1.9.2...v1.9.3

v1.9.2

29 Nov 19:22
471e8ec
Compare
Choose a tag to compare

What's Changed

  • [FIX] processInfo() unexpected error was mapped as BadAuthentication, when it should just be the error it was by @aricart in #413
  • [FIX] jetstream fetch() error while disconnected from the server resulted in a connection close() by @aricart in #417

Full Changelog: v1.9.1...v1.9.2

v1.9.1

23 Nov 19:47
556ef66
Compare
Choose a tag to compare

What's Changed

  • [FEAT] Added connect option ignoreAuthErrorAbort which disables a connection abort when the client fails to authenticate twice with the same error. by @aricart in #409
  • [FIX] Remove ambiguity on async errors by only recording non-permission errors, also subscriptions for which a permission error is raised by the server are now closed and reaped @aricart in #410
  • [FEAT] Several Authenticator Enhancements - all authenticators can now specify a function for values, and values are not pre-cached, so it is possible for the client to obtain additional credentials and use them to reconnect. Note these functions cannot delay the authentication process or client may be disconnected by the server if a deadline is exceeded. by @aricart in #412

Full Changelog: v1.9.0...v1.9.1

v1.9.0

02 Nov 20:01
0471b24
Compare
Choose a tag to compare

What's Changed

  • [FEAT] [JETSTREAM] added support for new consumer creation API by @aricart in #353

  • [FEAT] [JETSTREAM] StreamConfig now has mirror_direct option by @aricart in #355

  • [FEAT] [JETSTREAM] added support consumer heartbeats (push consumers, and fetch apis only) by @aricart in #327

  • [FIX] [JETSTREAM] Added validation of name option in ConsumerConfig by @aricart in #362

  • [FEAT] [JETSTREAM] JSM now provides API to list kvs and objectstores by @aricart in #364

  • [FEAT] [JETSTREAM] StreamInfo pagination support for streams that request a list of subjects by @aricart in #365

  • [FIX] [JETSTREAM] paged responses for stream info didn't take into account changing total reported by the server by @aricart in #368

  • [FEAT] [JETSTREAM] jsm.streams.list() can now specify a subject filter by @aricart in #369

  • [FIX] [JETSTREAM] added server version checks for kv and objectstore usage by @aricart in #371

  • [FEAT] [JETSTREAM] added support for discard_new_per_subject functionality on StreamConfig and KV uses by @aricart in #373

  • [FEAT] [JETSTREAM] Ordered consumer changes by @aricart in #376

  • [FEAT] [JETSTREAM] added JSM API to list stream names by @aricart in #379

  • [FIX] [OBJECTSTORE] getting a deleted entry, resolves to null. by @aricart in #351

  • [FIX] [OBJECTSTORE] fixed an issue where an entry's info was not properly generated when the entry had no partial chunks by @aricart in #358

  • [FIX] [OBJECTSTORE] added additional checks to update by @aricart in #363

  • [FIX] [OBJECTSTORE] made put() reject link configurations by @aricart in #367

  • [FIX] [OBJECTSTORE] made meta subject compatible across clients by @tothandras in #372

  • [FIX] [OBJECTSTORE] updated sha-digest prefix to match changes in Go client by @tothandras in #382

  • [TEST] [OBJECTSTORE] fix tests referencing old digest prefix by @aricart in #384

  • [DOC] added link to JS doc by @aricart in #352

  • [CHANGE] [KV] by default kv enables allow_direct unless client opts-out. by @aricart in #361

  • [FEAT] [KV] exposed size of the bucket via KvStatus.size by @aricart in #378

  • [FEAT] [KV] Added support to access KV mirrors by @aricart in #391

  • [INTERNAL] added support for Feature disablements by @aricart in #366

  • [FIX] [DOC] links in the documentation, missing types by @aricart in #380

  • [FEAT] [CORE] added ability for client to set a status on a header by @aricart in #386

  • [FIX] [CORE] subscription closed, terminated iterators that had pending messages before the client was able to process them by @aricart in #388

  • [FIX] [CORE] added fixes to prevent unhandled rejection of initial PONG promise, ensured that if the client closed due to an error, that the close handler wouldn't attempt to flush the pending buffer as the connection is already gone by @aricart in #390

  • [CI] updated nats-server to 2.9.5, and deno to 1.27.0 by @aricart in #392

  • [TEST] [JETSTREAM] added test verifying that new consumer creation accepts durable_name and name when same, and rejects when different. by @aricart in #360

  • [TEST] [JETSTREAM] fixed cross account test to allow acks to reach the source stream by @aricart in #374

  • [TEST] [OBJECTSTORE] added a test for object store that verifies generated hashes against expected hashes by @aricart in #359

New Contributors

Full Changelog: v1.8.0...v1.9.0

v1.8.0

22 Aug 19:42
fe20776
Compare
Choose a tag to compare

What's Changed

  • [CHANGE] [JETSTREAM] StreamUpdateConfig can now update num_replicas option by @aricart in #313, #314.

  • [CHANGE] [JETSTREAM] StreamConfig's placement, deny_delete and deny_purge options are now updatable and part of StreamUpdateConfig. Option StreamConfig.template_owner is removed as option is not supported. by @aricart in #314

  • [FIX] [JETSTREAM] JetStreamManager.streams.update() now retrieves the existing stream configuration and applies values specified to the retrieved configuration. This prevents unexpected changes from being set on a stream due to the server reacting to defaulted values in the JSON configuration. by @aricart in #315.

  • [FEAT] [JETSTREAM] library now adds support for the "Direct GET Message API" from the server. This API offers increased performance at the risk of retrieving an old value that is in flight for an update (such as adding a message to a stream and then immediately attempting to retrieve it by its subject). This API call can retrieve messages from any stream replicas regardless of the current leader status for the stream. This feature is only available on 3.9.0 servers, and it is intended for KV get applications. by @aricart in #316, #320, #325, #341

  • [FEAT] [JETSTREAM] StreamUpdateConfig.republish allows the nats-server to republish messages that are ingested by a stream to a different subject. The message published is a NATS core message. The configuration allows mapping a filter (src) subject to a destination subject, and whether only headers should be sent. Messages that are republished will have NATS-specific headers (grouped under the RepublishHeaders enum) that allow the client to identify the stream, subject, sequence, last sequence and size of the message. by @aricart in #333

  • [FEAT] [JETSTREAM] Pull consumers can now specify max_bytes as a PullOptions. This option will limit the number of messages the server returns to fit into the specified max_bytes option. Note that if the stream contains a message that exceeds max_bytes, the consumer will fail, as the request cannot be honored. by @aricart in #318

  • [FIX] [JETSTREAM] when binding to a stream, the consumer didn't capture the durable_name or name in case of ephemerals, which failed info() requests on the pull/push consumer. by @aricart in #330

  • [FEAT] [JETSTREAM] JetStreamClient.publish() now has the options retries and retry_delay. These options configure the client to reattempt publishing a message is rejected with a 503 (JetStream is not available) error. These options are not yet exposed in JetStreamPublishOptions type, but can be set and will be by @aricart in honored. #334.

  • [FEAT] [JETSTREAM] ConsumerOptsBuilder can now set memory() and numReplicas(number) options. These options instruct the nats-server to maintain the consumer's state in memory and/or the number of replicas to use rather than inherit a setting from the stream. by @aricart in #336, #337

  • [FIX] [JETSTREAM] AccountLimits now types max_ack_pending by @aricart in #321

  • [FIX] [KV] KvOptions.placementCluster was not honored. KvOptions.maxBucketSize, KvOptions.backingStore, KvOptions.placementCluster are now deprecated use KvOptions.max_bytes, KvOptions.storage, KvOptions.placement instead. KvStatus.backingStore and KvStatus.bucketLocation are deprecated, use KvStatus.storage and KvStatus.placement instead. KvStatus returned by Kv.status() now reports the storage type and the number of replicas, and ttl is expressed in millis. by @aricart in #314, #340, #350

  • [FEAT] [KV] KV client enables the GET direct message API when the option allow_direct is specified or the client connects to a 3.9.0 or better server. by @aricart in #316

  • [FEAT] [KV] KV can now specify a republish configuration in KvOptions.republish. by @aricart in #340

  • [FEAT] [ObjectStore] [BETA] A new materialized view, ObjectStore is now available under JetStreamClient.views.os. ObjectStore allows you to store large assets whose contents are split into multiple chunks in a stream. The API relies on standard JavaScript ReadableStream. This feature makes use of crypto.subtle JavaScript APIs. This API is shimmed on node versions greater than 14. Node 14 will require a user-provided shim to work. The API for this functionality is likely to change. by @aricart in #339.

  • [FEAT] [CORE] [EXPERIMENTAL] The client can now perform scatter/gather type requests by using requestMany(subject: string, data: Uint8Array, opts: {maxWait: 1000, maxMessages: -1}): Promise<QueuedIterator<Msg|Error>. This request will gather and return multiple responses from a request (whether from a single service responding with multiple messages or responses from multiple services). For more information, check out the tests - note you'll need to cast the client to a NatsConnectionImpl to expose the functionality under typescript. by @aricart in #326. The API implements multiple strategies, such as:

    • Wait for a fixed timer to expire before returning results
    • Wait for some number of messages to be received or a timer to expire
    • Wait for an unknown number of messages to arrive, which stops collecting after 300 milliseconds (not yet configurable) from the last message delivered
    • Wait until a message with no payload is received.
  • [FIX] [CORE] Added support for tls_available. This server info option is set by the nats-server when allow_non_tls is configured in the server, allowing the server to use TLS and plain connections at the same time. By default, the client will attempt to upgrade to TLS if available. To prevent the upgrade from happening, set the tls connection option to null. If not set, the client will attempt an upgrade. If TLS is configured, TLS will be required. by @aricart in #348. Thanks to @reecefenwick for the initial model fix.

  • [FIX] Cleaned up the use of the Date API to explicitly call parse rather than parse the string. by @aricart in #343

  • [DOC] Most types and APIs on the client now have proper comments (JSDoc). The documentation is hosted live as https://nats-io.github.io/nats.deno. Note that this documentation is shared between all nats-base-client APIs (nats.js, nats.deno, nats.ws). by @aricart in #333, #346

  • [DOC] Fix the wrong name for a variable by @jonaslagoni in #332

  • [UPDATE] updated dependencies on nkeys.

Deno Specific

  • [UPDATE] Updated Deno to 1.24.3 and std 0.152.0.

New Contributors

Full Changelog: v1.7.1...v1.8.0

v1.7.1

26 May 19:59
bae23ac
Compare
Choose a tag to compare

What's Changed

  • [CHANGE] internal API change Transport.send() to not return a promise - previously any send resulted in a promise, however rejecting of the promise is only interesting in some very specific cases, yet it complexified downstream handling, which in some cases resulted in unhandled promises see #271 by @aricart in #312

Other Changes

  • [TEST] added a test to verify that an iterator on a subscription permission error will throw the permissions error by @aricart in #309
  • [CHORE] silenced tests that were outputting to stdout (except for test on debug connect option) by @aricart in #310
  • [FEAT] [EXPERIMENTAL] requestMany() by @aricart in #311

Full Changelog: v1.7.0...v1.7.1

v1.7.0

18 May 17:26
d622b01
Compare
Choose a tag to compare

What's Changed

  • [CHANGE] [CORE] previous versions of the nats javascript clients closed a connection when a permissions error was received by the client. This change instead simply ends the subscription to match other client implementations. For subscriptions that use callbacks, the error will be reported in the error argument, for iterators will throw an error. As before, the connection status() will report the same error by @aricart in #267

  • [FEAT] [CORE] Added the ability for the client to report the number of millis in a roundtrip to the server nc#rtt(): Promise<number> by @aricart in #307

  • [FEAT] [CORE] it is now possible to specify a usernamePasswordAuthenticator() or tokenAuthenticator() instead of the user/pass and token connect options by @aricart in #287

  • [FEAT] [CORE] Permission errors are now exposed to request API uses, for example, if the request subject has a pub permission issue, the request will fail with the permission error. Similarly, if the problem is with the subscription handling the inbox for the request, the request will fail with the permission error - previously these requests failed with a timeout by @aricart in #296

  • [FIX] [CORE] several unhandled promises on transport.send() raised exceptions elsewhere in the library which could crash the client. The transport send errors are typically ignored except during connect, as the client handles connection failures on the read side of the socket by @aricart in #289

  • [FIX] [CORE] conn.closed() resolved error not always reported the actual error that triggered the close by @aricart in #294 and #290

  • [FIX] [CORE] Requests that used noMux ignored any specified headers by @Kjir in #306

JetStream Changes

  • [FEAT] [JS] [Experimental] JSMsg.next() - pull subscription use only! - combines a pull for the next message (or batch) and ack() in one call. Note that this functionality is experimental and not well behaved with iterators by @aricart in #282 and #284.

  • [FEAT] [JS] updated StreamInfo to report alternates - alternates are mirrors to the specified stream ordered by latency with respect to the client searching for the stream. This feature allows for tools to learn about other mirrors to the stream and select a different one if desired by @aricart in #291

  • [FEAT] [JS] jsm.streams.info() can now provide a request option for subjects_filter, which triggers the stream info to report the actual subjects stored in the stream (up to some 10K subject limit) - ADR issue 91 by @aricart in #293

  • [FEAT] [JS] The library now checks for push_bound consumer value. When set by the server, this signals that there's already a subscription supporting the push consumer. In cases where the consumer is not part of a deliver_group and this is set, the subscription will reject, this signals an API usage error, since multiple push subscriptions on a consumer requires the consumer to have a deliver_group set @aricart in #298

  • [FEAT] [JS] [nats-server 2.7.2 or greater] added support for ConsumerConfiguration backoff - backoff is a list of retry intervals when the server will re-send messages that are outstanding (not ack'ed) - Note that when specifying backoff the max_deliver option must be greater than the backoff list. The list is in Nanos, so use nanos(millis) to convert @aricart in #300

  • [FIX] [JS] some JS status errors were processed prematurely by the core NATS request functionality @aricart in #288

  • [FIX] [JS] when specifying bind, if the consumer didn't specify deliver_to was identified as pull consumer @aricart in #269

  • [DOC] [JS] better pull example that allows seeing redeliveries @aricart in #277

  • [FEAT] [JS] updated jsm#getAccountInfo() to report tiered usage and limits. Tiered limits report R1 (no replication) and R3 (R3 replication) JetStream limit values assigned to an account by @aricart in #307

JetStream KV Changes

  • [CHANGE] [KV] will now use DiscardPolicy.New when creating KVs on nats-servers 2.7.2 or better @aricart in #262 and @aricart in #270

  • [FEAT] [KV] watch now takes an optional callback that gets called once existing values have been seen - the watch will continue to run notifying of other changes @aricart in #262, @aricart in #264

  • [FEAT] [JS] Allow chaining ConsumerOptions builder by @avin-kavish in #283

  • [FEAT] [KV] jsclient.views.kv() can now specify a bindOnly option which forces the KV to bind to the specify stream or fail by @Jarema in #276

  • [FIX] [KV] fixed a bug in history() which could terminate the iterator before client code got a chance to process the notification by @aricart in #281

  • [FEAT] [KV] adds the ability to request a specific revision (sequence) for a key - note the request will reject if the requested revision doesn't resolve to the specified key by @aricart in #302

  • [FEAT] [KV] [EXPERIMENTAL] added (internal for now) ability to purgeDeletes(millis) which purges KV from deleted values older than the specified number of millis by @aricart in #304

Other

  • [FIX] [TEST] external test didn't import nkeys correctly by @aricart in #295

  • [CHORE] [TEST] cluster tool required update due to changes on deno for handling signals by @aricart in #285

  • [CHORE] [CI] nats-server version by @aricart in #260

  • [CHORE] [CI] deno 1.18.x by @aricart in #261

New Contributors

Full Changelog: v1.6.1...v1.7.0