3939from ...util .notebook_ui .components .sync import Label
4040from ...util .notebook_ui .components .sync import SyncTableObject
4141from ...util .notebook_ui .icons import Icon
42+ from ...util .util import prompt_warning_message
4243from ..action .action_object import ActionObject
4344from ..action .action_permissions import ActionObjectPermission
4445from ..action .action_permissions import ActionPermission
@@ -1192,6 +1193,7 @@ def from_sync_state(
11921193 _include_server_status : bool = False ,
11931194 ) -> "ServerDiff" :
11941195 obj_uid_to_diff = {}
1196+ show_deletion_warning = False
11951197 for obj_id in set (low_state .objects .keys ()) | set (high_state .objects .keys ()):
11961198 low_obj = low_state .objects .get (obj_id , None )
11971199 high_obj = high_state .objects .get (obj_id , None )
@@ -1216,6 +1218,7 @@ def from_sync_state(
12161218 # So, skip if the object is not present on the *source* side
12171219 source_obj = low_obj if direction == SyncDirection .LOW_TO_HIGH else high_obj
12181220 if source_obj is None :
1221+ show_deletion_warning = True
12191222 continue
12201223
12211224 diff = ObjectDiff .from_objects (
@@ -1272,6 +1275,15 @@ def from_sync_state(
12721275 inplace = True ,
12731276 )
12741277
1278+ if show_deletion_warning :
1279+ prompt_warning_message (
1280+ message = (
1281+ "The target server has objects not found on the source server. "
1282+ "These objects cannot be deleted via syncing and only manual deletion is possible."
1283+ ),
1284+ confirm = False ,
1285+ )
1286+
12751287 return res
12761288
12771289 @staticmethod
0 commit comments