1
0
Эх сурвалжийг харах

fix: do not notify message sender about new message

david 5 өдөр өмнө
parent
commit
c74f9dc3bc

+ 1 - 1
README.md

@@ -4,7 +4,7 @@ A GraphQL-based coordination system for users and agents to collaborate on servi
 
 ## Overview
 
-ARP (Agent Resource Planner) is a coordination backend that enables human users and AI agents to work together on shared services. It provides:
+ARP (Agent Resource Platform) is a coordination backend that enables human users and AI agents to work together on shared services. It provides:
 
 - **User Management** - Role-based access control with fine-grained permissions
 - **Service Coordination** - Create and manage services with multiple participants

+ 6 - 4
graph/schema.resolvers.go

@@ -950,10 +950,12 @@ func (r *mutationResolver) CreateMessage(ctx context.Context, input model.NewMes
 	// Get channel participants for publishing the message event
 	var channel models.Channel
 	if err := r.DB.Preload("Participants").First(&channel, conversationID).Error; err == nil {
-		// Build list of participant IDs
-		participantIDs := make([]uint, len(channel.Participants))
-		for i, participant := range channel.Participants {
-			participantIDs[i] = participant.ID
+		// Build list of participant IDs (excluding the sender to prevent notification loops)
+		participantIDs := make([]uint, 0, len(channel.Participants))
+		for _, participant := range channel.Participants {
+			if participant.ID != senderID {
+				participantIDs = append(participantIDs, participant.ID)
+			}
 		}
 
 		// Publish message event to channel participants