@@ -503,9 +503,20 @@ fn process_updater(
503503 if let Some ( mut updater) = tauri_config. remove ( "updater" ) {
504504 if let Some ( updater) = updater. as_object_mut ( ) {
505505 updater. remove ( "dialog" ) ;
506- updater. remove ( "active" ) ;
506+
507+ // we only migrate the updater config if it's active
508+ // since we now assume it's always active if the config object is set
509+ // we also migrate if pubkey is set so we do not lose that information on the migration
510+ // in this case, the user need to deal with the updater being inactive on their own
511+ if updater
512+ . remove ( "active" )
513+ . and_then ( |a| a. as_bool ( ) )
514+ . unwrap_or_default ( )
515+ || updater. get ( "pubkey" ) . is_some ( )
516+ {
517+ plugins. insert ( "updater" . into ( ) , serde_json:: to_value ( updater) ?) ;
518+ }
507519 }
508- plugins. insert ( "updater" . into ( ) , serde_json:: to_value ( updater) ?) ;
509520 }
510521
511522 Ok ( ( ) )
@@ -711,6 +722,38 @@ mod test {
711722 ) ;
712723 }
713724
725+ #[ test]
726+ fn skips_migrating_updater ( ) {
727+ let original = serde_json:: json!( {
728+ "tauri" : {
729+ "updater" : {
730+ "active" : false
731+ }
732+ }
733+ } ) ;
734+
735+ let migrated = migrate ( & original) ;
736+ assert_eq ! ( migrated[ "plugins" ] [ "updater" ] , serde_json:: Value :: Null ) ;
737+ }
738+
739+ #[ test]
740+ fn migrate_updater_pubkey ( ) {
741+ let original = serde_json:: json!( {
742+ "tauri" : {
743+ "updater" : {
744+ "active" : false ,
745+ "pubkey" : "somekey"
746+ }
747+ }
748+ } ) ;
749+
750+ let migrated = migrate ( & original) ;
751+ assert_eq ! (
752+ migrated[ "plugins" ] [ "updater" ] [ "pubkey" ] ,
753+ original[ "tauri" ] [ "updater" ] [ "pubkey" ]
754+ ) ;
755+ }
756+
714757 #[ test]
715758 fn migrate_csp_object ( ) {
716759 let original = serde_json:: json!( {
0 commit comments