@@ -421,6 +421,8 @@ impl Ctx {
421421 generation,
422422 config,
423423 } => {
424+ let metadata = config. metadata . deserialize ( ) ?;
425+
424426 let mut actors = self . actors . write ( ) . await ;
425427
426428 if actors. contains_key ( & ( actor_id, generation) ) {
@@ -430,7 +432,7 @@ impl Ctx {
430432 "actor with this actor id + generation already exists, ignoring start command" ,
431433 ) ;
432434 } else {
433- let actor = Actor :: new ( actor_id, generation, * config) ;
435+ let actor = Actor :: new ( actor_id, generation, * config, metadata ) ;
434436
435437 // Insert actor
436438 actors. insert ( ( actor_id, generation) , actor) ;
@@ -718,6 +720,7 @@ impl Ctx {
718720
719721 let config = serde_json:: from_slice :: < protocol:: ActorConfig > ( & row. config ) ?;
720722 let generation = row. generation . try_into ( ) ?;
723+ let metadata = config. metadata . deserialize ( ) ?;
721724
722725 match & isolate_runner {
723726 Some ( isolate_runner) if pid == isolate_runner. pid ( ) . as_raw ( ) => { }
@@ -736,7 +739,7 @@ impl Ctx {
736739 }
737740
738741 // Clean up actor. We run `cleanup_setup` instead of `cleanup` because `cleanup` publishes events.
739- let actor = Actor :: new ( row. actor_id , generation, config) ;
742+ let actor = Actor :: new ( row. actor_id , generation, config, metadata ) ;
740743 actor. cleanup_setup ( self ) . await ;
741744 }
742745
@@ -878,6 +881,7 @@ impl Ctx {
878881
879882 let config = serde_json:: from_slice :: < protocol:: ActorConfig > ( & row. config ) ?;
880883 let generation = row. generation . try_into ( ) ?;
884+ let metadata = config. metadata . deserialize ( ) ?;
881885
882886 let runner = match & isolate_runner {
883887 // We have to clone the existing isolate runner handle instead of creating a new one so it
@@ -901,7 +905,7 @@ impl Ctx {
901905 } ,
902906 } ;
903907
904- let actor = Actor :: with_runner ( row. actor_id , generation, config, runner) ;
908+ let actor = Actor :: with_runner ( row. actor_id , generation, config, metadata , runner) ;
905909 let actor = actors_guard
906910 . entry ( ( row. actor_id , generation) )
907911 . or_insert ( actor) ;
0 commit comments