diff --git a/elixir/apps/api/lib/api/gateway/channel.ex b/elixir/apps/api/lib/api/gateway/channel.ex index 213dd6441..c1a88d03e 100644 --- a/elixir/apps/api/lib/api/gateway/channel.ex +++ b/elixir/apps/api/lib/api/gateway/channel.ex @@ -72,6 +72,12 @@ defmodule API.Gateway.Channel do ##### Reacting to domain events #### #################################### + # Resource create message is a no-op for the Gateway as the Resource + # details will be sent to the Gateway on an :authorize_flow message + def handle_info({:create_resource, _resource_id}, socket) do + {:norely, socket} + end + # Resource is updated, eg. traffic filters are changed def handle_info({:update_resource, resource_id}, socket) do OpenTelemetry.Ctx.attach(socket.assigns.opentelemetry_ctx) diff --git a/elixir/apps/api/test/api/gateway/channel_test.exs b/elixir/apps/api/test/api/gateway/channel_test.exs index ec85b161f..d5c8e7678 100644 --- a/elixir/apps/api/test/api/gateway/channel_test.exs +++ b/elixir/apps/api/test/api/gateway/channel_test.exs @@ -446,6 +446,15 @@ defmodule API.Gateway.ChannelTest do end end + describe "handle_info/2 :create_resource" do + test "does nothing", %{ + resource: resource, + socket: socket + } do + send(socket.channel_pid, {:create_resource, resource.id}) + end + end + describe "handle_info/2 :delete_resource" do test "does nothing", %{ resource: resource,