diff --git a/fedn/network/storage/statestore/mongostatestore.py b/fedn/network/storage/statestore/mongostatestore.py index ffae773d0..7ef22a795 100644 --- a/fedn/network/storage/statestore/mongostatestore.py +++ b/fedn/network/storage/statestore/mongostatestore.py @@ -742,6 +742,8 @@ def set_client(self, client_data): self.clients.update_one({"client_id": client_data["client_id"]}, {"$set": client_data}, True) except KeyError: # If client_id is not present, use name as identifier, for backwards compatibility + id = str(uuid.uuid4()) + client_data["client_id"] = id self.clients.update_one({"name": client_data["name"]}, {"$set": client_data}, True) def get_client(self, client_id):