@@ -100,7 +100,13 @@ async def update_deferred_edges(self, edges: List[Tuple[NodeId, NodeId, str]], t
100100
101101 @abstractmethod
102102 async def update_node (
103- self , model : Model , node_id : NodeId , patch_or_replace : Json , replace : bool , section : Optional [str ]
103+ self ,
104+ model : Model ,
105+ node_id : NodeId ,
106+ patch_or_replace : Json ,
107+ replace : bool ,
108+ section : Optional [str ],
109+ force : bool = False ,
104110 ) -> Json :
105111 pass
106112
@@ -335,9 +341,15 @@ def deletion_query(edge_collection: str) -> str:
335341 return updated_edges , deleted_edges
336342
337343 async def update_node (
338- self , model : Model , node_id : NodeId , patch_or_replace : Json , replace : bool , section : Optional [str ]
344+ self ,
345+ model : Model ,
346+ node_id : NodeId ,
347+ patch_or_replace : Json ,
348+ replace : bool ,
349+ section : Optional [str ],
350+ force : bool = False ,
339351 ) -> Json :
340- return await self .update_node_with (self .db , model , node_id , patch_or_replace , replace , section )
352+ return await self .update_node_with (self .db , model , node_id , patch_or_replace , replace , section , force )
341353
342354 async def update_node_with (
343355 self ,
@@ -347,6 +359,7 @@ async def update_node_with(
347359 patch_or_replace : Json ,
348360 replace : bool ,
349361 section : Optional [str ],
362+ force : bool = False ,
350363 ) -> Json :
351364 log .info (f"Update node with node_id={ node_id } , section={ section } , replace={ replace } , update={ patch_or_replace } " )
352365 node = await self .by_id_with (db , node_id )
@@ -400,7 +413,7 @@ async def update_resolved_property(id_prop: ResolveProp, patch: Json, history: b
400413 for prop in ra .resolved_props ():
401414 if value_in_path (node , prop .extract_path ) != (nv := value_in_path (update , prop .extract_path )):
402415 set_value_in_path (nv , prop .to_path , changes )
403- if changes :
416+ if changes or force :
404417 await update_resolved_property (rid , changes , False )
405418 await update_resolved_property (rid , changes , True )
406419
@@ -1649,7 +1662,13 @@ async def update_deferred_edges(self, edges: List[Tuple[NodeId, NodeId, str]], t
16491662 return updated , deleted
16501663
16511664 async def update_node (
1652- self , model : Model , node_id : NodeId , patch_or_replace : Json , replace : bool , section : Optional [str ]
1665+ self ,
1666+ model : Model ,
1667+ node_id : NodeId ,
1668+ patch_or_replace : Json ,
1669+ replace : bool ,
1670+ section : Optional [str ],
1671+ force : bool = False ,
16531672 ) -> Json :
16541673 result = await self .real .update_node (model , node_id , patch_or_replace , replace , section )
16551674 await self .event_sender .core_event (CoreEvent .NodeUpdated , {"graph" : self .graph_name , "section" : section })
0 commit comments