Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ export class WebhookController {
return res.status(200).send("Skipped Match ID group");
}

// Check if this is a DM with DM ID in description (already processed)
if (local.data.description && typeof local.data.description === 'string' && local.data.description.startsWith('DM ID:')) {
console.log("⏭️ Skipping DM creation - this DM has DM ID in description (already processed)");
await this.webhookProcessingService.markWebhookCompleted(req.body);
return res.status(200).send("Skipped DM ID group");
}

let participants: User[] = [];
if (
local.data.participants &&
Expand Down
4 changes: 2 additions & 2 deletions platforms/dreamsync-api/src/services/ConsentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1379,14 +1379,14 @@ DreamSync Team
// Create new mutual chat
console.log(`🔧 ConsentService: Creating mutual chat with:`);
console.log(` - Name: DreamSync Chat with ${userId}`);
console.log(` - Description: Private chat with DreamSync platform`);
console.log(` - Description: DM ID: ${userId}::${dreamsyncUser.id}`);
console.log(` - Owner: ${dreamsyncUser.id}`);
console.log(` - Members: [${dreamsyncUser.id}, ${userId}]`);
console.log(` - Private: true`);

const mutualChat = await this.groupService.createGroup(
`DreamSync Chat with ${userId}`,
"Private chat with DreamSync platform",
`DM ID: ${userId}::${dreamsyncUser.id}`,
dreamsyncUser.id,
[dreamsyncUser.id],
[dreamsyncUser.id, userId],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export class MatchNotificationService {
console.log(`🆕 No existing mutual chat found, creating new one...`);

// Create a new mutual chat
const chatName = `DreamSync Chat`;
const chatDescription = `Private chat between DreamSync and user for match notifications`;
const chatName = `DreamSync Chat with ${targetUserId}`;
const chatDescription = `DM ID: ${targetUserId}::${dreamsyncUser.id}`;

console.log(`🔧 Creating mutual chat with:`);
console.log(` - Name: ${chatName}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,12 @@ export class PostgresSubscriber implements EntitySubscriberInterface {
return;
}

// Skip DMs with DM ID in description (already processed)
if (data.description && typeof data.description === 'string' && data.description.startsWith('DM ID:')) {
console.log(`🔍 Skipping DM webhook - has DM ID in description: ${data.description}`);
return;
}

let globalId = await this.adapter.mappingDb.getGlobalId(data.id);
globalId = globalId ?? "";

Expand Down
Loading