Skip to content

Commit

Permalink
fix stream name when acror name contains a dot
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasdarruda committed Jan 6, 2025
1 parent f60d0ee commit e04553a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/actors/actor/entity/invocation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,9 @@ defmodule Actors.Actor.Entity.Invocation do

defp do_handle_projection(id, action, %{sourceable: true} = _settings, _state, response) do
stream_name = StreamInitiator.stream_name(id)
id_name = String.replace(id.name, ".", "-")

subject = "actors.#{stream_name}.#{id.name}.#{action}"
subject = "actors.#{stream_name}.#{id_name}.#{action}"
payload = Google.Protobuf.Any.encode(response.updated_context.state)

uuid = UUID.uuid4(:hex)
Expand Down
2 changes: 1 addition & 1 deletion lib/actors/actor/entity/lifecycle/stream_initiator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,6 @@ defmodule Actors.Actor.Entity.Lifecycle.StreamInitiator do
do: actor_id.name,
else: actor_id.parent

"#{actor_id.system}-#{actor_name}"
String.replace("#{actor_id.system}-#{actor_name}", ".", "-")
end
end

0 comments on commit e04553a

Please sign in to comment.