@@ -237,19 +237,19 @@ defmodule Actors.Actor.Entity.Invocation do
237
237
Tracer . with_span "invoke-host" do
238
238
interface . invoke_host ( request , state , @ default_actions )
239
239
|> case do
240
- { :ok , response , state } ->
240
+ { :ok , response , new_state } ->
241
241
Tracer . add_event ( "successful-invocation" , [
242
242
{ :ok , "#{ inspect ( response . updated_context . metadata ) } " }
243
243
] )
244
244
245
- build_response ( request , response , state , opts )
245
+ build_response ( request , response , new_state , opts )
246
246
247
- { :error , reason , state } ->
247
+ { :error , reason , new_state } ->
248
248
Tracer . add_event ( "failure-invocation" , [
249
249
{ :error , "#{ inspect ( reason ) } " }
250
250
] )
251
251
252
- { :reply , { :error , reason } , state , :hibernate }
252
+ { :reply , { :error , reason } , new_state , :hibernate }
253
253
end
254
254
end
255
255
@@ -278,6 +278,8 @@ defmodule Actors.Actor.Entity.Invocation do
278
278
current_state = Map . get ( actor_state || % { } , :state )
279
279
current_tags = Map . get ( actor_state || % { } , :tags , % { } )
280
280
281
+ # TODO: Validate state before invoke
282
+
281
283
% ActorInvocation {
282
284
actor: id ,
283
285
command_name: command ,
0 commit comments