diff --git a/fedn/network/storage/statestore/stores/client_store.py b/fedn/network/storage/statestore/stores/client_store.py index 8c67da9ab..c2be71564 100644 --- a/fedn/network/storage/statestore/stores/client_store.py +++ b/fedn/network/storage/statestore/stores/client_store.py @@ -60,14 +60,11 @@ def _get_client_by_client_id(self, client_id: str) -> Dict: raise EntityNotFound(f"Entity with client_id {client_id} not found") return document - def update(self, by_key: str, value: str, item: Client) -> bool: + def update(self, id: str, item: Client) -> Tuple[bool, Any]: try: - result = self.database[self.collection].update_one({by_key: value}, {"$set": item}) - if result.modified_count == 1: - document = self.database[self.collection].find_one({by_key: value}) - return True, from_document(document) - else: - return False, "Entity not found" + existing_client = self.get(id) + + return super().update(existing_client["id"], item) except Exception as e: return False, str(e)