def METHOD_NAME(self, session, event):
    # Try to commit and if any error happen then recreate session
    entities_info = event["data"]["entities"]
    dependency_changes = []
    removed_entities = set()
    for entity_info in entities_info:
        action = entity_info.get("action")
        entityType = entity_info.get("entityType")
        if action not in ("remove", "add"):
            continue
        if entityType == "task":
            removed_entities.add(entity_info["entityId"])
        elif entityType == "dependency":
            dependency_changes.append(entity_info)
    # Care only about dependency changes
    if not dependency_changes:
        return
    project_id = None
    for entity_info in dependency_changes:
        for parent_info in entity_info["parents"]:
            if parent_info["entityType"] == "show":
                project_id = parent_info["entityId"]
        if project_id is not None:
            break
    changed_to_ids = set()
    for entity_info in dependency_changes:
        to_id_change = entity_info["changes"]["to_id"]
        if to_id_change["new"] is not None:
            changed_to_ids.add(to_id_change["new"])
        if to_id_change["old"] is not None:
            changed_to_ids.add(to_id_change["old"])
    self._update_in_links(session, changed_to_ids, project_id)