You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7ce573c
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
3
3
## 1.18.0
4
4
5
+
***Behavior change:**`Gnat.start_link/2` now returns `{:error, reason}` when the TLS upgrade, the header support check or sending `CONNECT` fails, instead of crashing during initialization. TLS alerts come back as-is (for example `{:error, {:tls_alert, {:certificate_expired, _}}}`), so `Gnat.ConnectionSupervisor` logs why the connection failed. Invalid `ssl_opts` return `{:error, {:options, {option, :redacted}}}` because `:ssl` echoes the option value, which can be a key or password.
5
6
***Behavior change:**`Gnat.Jetstream.API.KV.put_value/5`, `delete_key/4`, and `purge_key/4` now validate the JetStream publish acknowledgement instead of reporting `:ok` for any reply. They share the same ack validation as `create_key/5`: a rejected write returns `{:error, reason}` with the server's error map, and a malformed or unrelated ack returns `{:error, :invalid_publish_ack}`. Previously a server-side rejection (for example a `put_value/5` larger than the bucket's `max_value_size`) was silently reported as `:ok`. See #235
6
7
***Behavior change:**`Gnat.Jetstream.API.KV.create_key/5` now only creates a key when one doesn't already exist. Previously it behaved like `put_value/5` and silently overwrote existing keys, and it returned `:ok` even when the server rejected the write. This aligns the library with the NATS server and the official clients: the publish is conditional on the key's current revision (`Nats-Expected-Last-Subject-Sequence`), so concurrent creators can't overwrite each other, and keys that were deleted or purged can be recreated. If you relied on `create_key` overwriting an existing key, use `put_value/5` instead. Thanks to @ericmj for #234
7
8
* Returns `{:error, :key_exists}` when a live value already exists for the key.
Copy file name to clipboardExpand all lines: lib/gnat/connection_supervisor.ex
+18-16Lines changed: 18 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,11 @@ defmodule Gnat.ConnectionSupervisor do
19
19
}
20
20
```
21
21
22
-
The connection settings can specify all of the same values that you pass to `Gnat.start_link/1`. Their secrets are redacted from this process's status and crash reports. Each time a connection is attempted we will use one of the provided connection settings to open the connection. This is a simplistic way of load balancing your connections across a cluster of nats nodes and allowing failover to other nodes in the cluster if one goes down.
22
+
The connection settings can specify all of the same values that you pass to `Gnat.start_link/1`. Each time a connection is attempted we will use one of the provided connection settings to open the connection. This is a simplistic way of load balancing your connections across a cluster of nats nodes and allowing failover to other nodes in the cluster if one goes down.
23
+
24
+
Credentials are redacted from connection configuration logs and formatted OTP
25
+
status and crash reports. The raw debugging limitations described in
26
+
`Gnat.start_link/2` also apply to this process.
23
27
24
28
To use this in your supervision tree add an entry like this:
25
29
@@ -41,6 +45,9 @@ defmodule Gnat.ConnectionSupervisor do
0 commit comments