Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add stream fields allow_direct and mirror_direct #161

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

djcarpe
Copy link

@djcarpe djcarpe commented Jun 19, 2024

When updating a stream that has allow_direct stream set to true will overwrite it within the server to false. It was a rather unexpected behavior. If there is a better way to implement this, please let me know. Thanks!

When updating a stream that has `allow_direct` stream
set to `true` will overwrite it within the server to `false`.
@djcarpe
Copy link
Author

djcarpe commented Jun 19, 2024

Adding an issue #162

@djcarpe
Copy link
Author

djcarpe commented Jun 19, 2024

And finally an example using my fork that does not override fields.

Untitled notebook

Mix.install([
  {:gnat, git: "https://github.com/djcarpe/nats.ex", tag: "0.00"}
])

Section

{:ok, conn} = Gnat.start_link(%{host: ~c"127.0.0.1", port: 4222})

{:ok, info} = Gnat.Jetstream.API.Stream.info(conn, "test")

config = info.config |> Map.put(:max_age, 130_000_000_000)

{:ok, _} = Gnat.Jetstream.API.Stream.update(conn, config)

Copy link
Collaborator

@mmmries mmmries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: these changes look spot on. I'm not sure why the update would have affected those fields if our code wasn't even trying to send them (maybe there's a different default for update than for create?), but either way being explicitly aware of the flags and sending the values from the user is the right thing to do. Thanks!

@mmmries mmmries merged commit 3df7739 into nats-io:main Jun 24, 2024
3 checks passed
@mmmries
Copy link
Collaborator

mmmries commented Jun 24, 2024

I've released this change in the 1.8.4 version https://github.com/nats-io/nats.ex/releases/tag/v1.8.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants