From 49d6d00a9225a0665dba9cc2383aeaf60f8f659f Mon Sep 17 00:00:00 2001 From: ishaansehgal99 Date: Wed, 9 Jul 2025 21:20:34 -0700 Subject: [PATCH] fix: Prevent duplicate push notifications from being sent per question --- servers/shared/core/agents.py | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/servers/shared/core/agents.py b/servers/shared/core/agents.py index 0ae9994..62f9db2 100644 --- a/servers/shared/core/agents.py +++ b/servers/shared/core/agents.py @@ -103,26 +103,9 @@ def create_agent_question( instance = validate_agent_access(db, agent_instance_id, user_id) # Create question + # Note: Push notification sent by create_question() function question = create_question(db, instance.id, question_text) - # Send push notification - try: - # Get agent name from instance - agent_name = instance.user_agent.name if instance.user_agent else "Agent" - - # Send notification - push_service.send_question_notification( - db=db, - user_id=instance.user_id, - instance_id=str(instance.id), - question_id=str(question.id), - agent_name=agent_name, - question_text=question_text, - ) - except Exception as e: - # Log error but don't fail the question creation - logger.error(f"Failed to send push notification: {e}") - return question