File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
platforms/dreamsync-api/src Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,13 @@ export class WebhookController {
164164 return res . status ( 200 ) . send ( "Skipped Match ID group" ) ;
165165 }
166166
167+ // Check if this is a DM with DM ID in description (already processed)
168+ if ( local . data . description && typeof local . data . description === 'string' && local . data . description . startsWith ( 'DM ID:' ) ) {
169+ console . log ( "⏭️ Skipping DM creation - this DM has DM ID in description (already processed)" ) ;
170+ await this . webhookProcessingService . markWebhookCompleted ( req . body ) ;
171+ return res . status ( 200 ) . send ( "Skipped DM ID group" ) ;
172+ }
173+
167174 let participants : User [ ] = [ ] ;
168175 if (
169176 local . data . participants &&
Original file line number Diff line number Diff line change @@ -1379,14 +1379,14 @@ DreamSync Team
13791379 // Create new mutual chat
13801380 console . log ( `🔧 ConsentService: Creating mutual chat with:` ) ;
13811381 console . log ( ` - Name: DreamSync Chat with ${ userId } ` ) ;
1382- console . log ( ` - Description: Private chat with DreamSync platform ` ) ;
1382+ console . log ( ` - Description: DM ID: ${ userId } :: ${ dreamsyncUser . id } ` ) ;
13831383 console . log ( ` - Owner: ${ dreamsyncUser . id } ` ) ;
13841384 console . log ( ` - Members: [${ dreamsyncUser . id } , ${ userId } ]` ) ;
13851385 console . log ( ` - Private: true` ) ;
13861386
13871387 const mutualChat = await this . groupService . createGroup (
13881388 `DreamSync Chat with ${ userId } ` ,
1389- "Private chat with DreamSync platform" ,
1389+ `DM ID: ${ userId } :: ${ dreamsyncUser . id } ` ,
13901390 dreamsyncUser . id ,
13911391 [ dreamsyncUser . id ] ,
13921392 [ dreamsyncUser . id , userId ] ,
Original file line number Diff line number Diff line change @@ -82,8 +82,8 @@ export class MatchNotificationService {
8282 console . log ( `🆕 No existing mutual chat found, creating new one...` ) ;
8383
8484 // Create a new mutual chat
85- const chatName = `DreamSync Chat` ;
86- const chatDescription = `Private chat between DreamSync and user for match notifications ` ;
85+ const chatName = `DreamSync Chat with ${ targetUserId } ` ;
86+ const chatDescription = `DM ID: ${ targetUserId } :: ${ dreamsyncUser . id } ` ;
8787
8888 console . log ( `🔧 Creating mutual chat with:` ) ;
8989 console . log ( ` - Name: ${ chatName } ` ) ;
Original file line number Diff line number Diff line change @@ -414,6 +414,12 @@ export class PostgresSubscriber implements EntitySubscriberInterface {
414414 return ;
415415 }
416416
417+ // Skip DMs with DM ID in description (already processed)
418+ if ( data . description && typeof data . description === 'string' && data . description . startsWith ( 'DM ID:' ) ) {
419+ console . log ( `🔍 Skipping DM webhook - has DM ID in description: ${ data . description } ` ) ;
420+ return ;
421+ }
422+
417423 let globalId = await this . adapter . mappingDb . getGlobalId ( data . id ) ;
418424 globalId = globalId ?? "" ;
419425
You can’t perform that action at this time.
0 commit comments