Skip to content

stream auth and sync#5

Merged
realACO merged 1 commit into
mainfrom
Auth-stream-sync
Mar 7, 2026
Merged

stream auth and sync#5
realACO merged 1 commit into
mainfrom
Auth-stream-sync

Conversation

@realACO
Copy link
Copy Markdown
Owner

@realACO realACO commented Mar 7, 2026

Summary by CodeRabbit

  • Chores
    • Configured chat service backend integration with automatic user account synchronization on account creation and deletion.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 7, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 79c1e6fe-d4fa-414b-a3ff-32306269218a

📥 Commits

Reviewing files that changed from the base of the PR and between 6f99904 and 99aeb4b.

⛔ Files ignored due to path filters (1)
  • backend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • backend/package.json
  • backend/src/lib/inngest.js
  • backend/src/lib/stream.js

📝 Walkthrough

Walkthrough

This PR integrates Stream Chat into the application's user management lifecycle. It adds the stream-chat dependency, creates a new Stream Chat client module with user upsert/delete operations, and extends existing Inngest handlers to synchronize users with Stream Chat whenever they're created or deleted in Clerk.

Changes

Cohort / File(s) Summary
Dependencies
backend/package.json
Added stream-chat v9.24.0 to project dependencies.
Stream Chat Module
backend/src/lib/stream.js
New module that initializes a StreamChat client with API credentials and exports helper functions for upserting and deleting users, with basic error handling and logging.
Inngest Handler Integration
backend/src/lib/inngest.js
Updated syncUser and deleteUserFromDB handlers to call Stream Chat upsert/delete operations alongside existing database operations; exported functions array now includes these handlers.

Sequence Diagram(s)

sequenceDiagram
    participant Clerk as Clerk Webhook
    participant Inngest
    participant DB as Database
    participant StreamChat as Stream Chat

    rect rgba(100, 150, 200, 0.5)
    Note over Clerk,StreamChat: User Creation Flow
    Clerk->>Inngest: user.created event
    Inngest->>DB: Connect & Create User
    DB-->>Inngest: User created
    Inngest->>StreamChat: upsertStreamUser(id, name, image)
    StreamChat-->>Inngest: User synced
    end

    rect rgba(150, 100, 200, 0.5)
    Note over Clerk,StreamChat: User Deletion Flow
    Clerk->>Inngest: user.deleted event
    Inngest->>DB: Connect & Delete User
    DB-->>Inngest: User deleted
    Inngest->>StreamChat: deleteStreamUser(userId)
    StreamChat-->>Inngest: User removed
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • auth and db sync #3: Directly extends the Inngest handlers by adding Stream Chat synchronization to the same user sync/delete functions, introducing the stream-chat integration module referenced here.

Poem

🐰 A Stream of chats now flows so bright,
When users join or say goodnight,
From Clerk to Inngest, DB too,
Stream Chat joins the rendezvous! 💬

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Auth-stream-sync

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

@realACO realACO merged commit 4c1ea21 into main Mar 7, 2026
1 check was pending
This was referenced Mar 7, 2026
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