Skip to content

Conversation

coodos
Copy link
Contributor

@coodos coodos commented Oct 15, 2025

Description of change

Issue Number

Type of change

  • Breaking (any change that would cause existing functionality to not work as expected)
  • New (a change which implements a new feature)
  • Update (a change which updates existing functionality)
  • Fix (a change which fixes an issue)
  • Docs (changes to the documentation)
  • Chore (refactoring, build scripts or anything else that isn't user-facing)

How the change has been tested

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • New Features
    • Enhanced chat labeling: new DMs now include recipient identifiers in the name and a DM ID in the description for clearer context.
  • Bug Fixes
    • Prevents duplicate DM group creation by skipping processing when a DM has already been handled, improving reliability.
    • Avoids reprocessing of DM-related webhooks by detecting DM IDs early and exiting safely.

@coodos coodos merged commit a022c46 into main Oct 15, 2025
0 of 3 checks passed
Copy link
Contributor

coderabbitai bot commented Oct 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a DM ID-based guard in group webhook processing to skip DM-derived groups and marks webhooks completed. Updates chat/group description strings to embed a “DM ID: {userId}::{dreamsyncUser.id}” pattern during mutual chat creation. No public API/signature changes.

Changes

Cohort / File(s) Summary
DM-derived group early-exit guards
platforms/dreamsync-api/src/controllers/WebhookController.ts, platforms/dreamsync-api/src/web3adapter/watchers/subscriber.ts
Add checks to skip processing when group description starts with "DM ID:"; logs and returns early (200 in controller), mirroring existing Match ID safeguards.
DM ID-based metadata for mutual chats
platforms/dreamsync-api/src/services/ConsentService.ts, platforms/dreamsync-api/src/services/MatchNotificationService.ts
Replace generic chat/group descriptions with "DM ID: {userId}::{dreamsyncUser.id}" and update chat name to include targetUserId; no control-flow or signature changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant W as Webhook Source
  participant S as Subscriber (sendGroupWebhook)
  participant C as WebhookController
  participant L as Logger

  W->>S: Group event
  S->>S: Check description prefix
  alt Description starts with "DM ID:" (new)
    S->>L: Log skip: DM-derived group
    S-->>W: Return (no webhook dispatched)
  else not DM-derived
    S->>C: Dispatch webhook
    C->>C: Validate group
    alt Description starts with "DM ID:" (new)
      C->>L: Log skip and mark completed
      C-->>S: 200 OK (early exit)
    else Other existing guards / normal flow
      C->>C: Continue processing
      C-->>S: Response
    end
  end
  note over S,C: New DM ID guards parallel existing "Match ID" checks
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paw—DMs in the dew,
A tidy tag: “DM ID” guides us through.
Webhooks hop past déjà-vu lanes,
Chats renamed with breadcrumb chains.
Carrot logs crisp, the garden clean—
Early exits swift and lean.
Onward, ears up, code serene.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/dreamsync-dual-initial-chat

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc4080e and ac890a1.

📒 Files selected for processing (4)
  • platforms/dreamsync-api/src/controllers/WebhookController.ts (1 hunks)
  • platforms/dreamsync-api/src/services/ConsentService.ts (1 hunks)
  • platforms/dreamsync-api/src/services/MatchNotificationService.ts (1 hunks)
  • platforms/dreamsync-api/src/web3adapter/watchers/subscriber.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coodos coodos deleted the fix/dreamsync-dual-initial-chat branch October 15, 2025 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant