Skip to content

Conversation

@ricardogarim
Copy link
Contributor

@ricardogarim ricardogarim commented Nov 10, 2025

Summary by CodeRabbit

  • New Features
    • Added capability to update member profiles through the SDK
    • Added capability to emit events through the SDK

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

The PR introduces EventEmitterService as a dependency in FederationSDK, adds a new public method updateMemberProfile that delegates to roomService, and exposes an emit method that delegates to eventEmitterService.

Changes

Cohort / File(s) Change Summary
FederationSDK Service Integration
packages/federation-sdk/src/sdk.ts
Added EventEmitterService dependency injection in constructor; exposed two new delegation methods: updateMemberProfile() forwarding calls to roomService, and emit() forwarding calls to eventEmitterService.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file modification with straightforward dependency injection pattern
  • Both new methods follow simple delegation pattern with no business logic
  • Minimal risk; mechanical wiring changes

Possibly related PRs

Poem

🐰 A rabbit hops with glee,
Two methods wired carefully,
EventEmitter hops along,
Member profiles strong,
Delegation makes SDK free! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: adding updateMemberProfile and emit methods to FederationSDK exports. It's specific, clear, and directly reflects the primary modifications in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 feat/add-updateMemberProfile-emit-sdk

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.

@ricardogarim ricardogarim force-pushed the feat/add-updateMemberProfile-emit-sdk branch from 394864d to 41f756c Compare November 10, 2025 12:16
@ricardogarim ricardogarim marked this pull request as ready for review November 10, 2025 12:16
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.43%. Comparing base (685ad17) to head (41f756c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/federation-sdk/src/sdk.ts 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #298      +/-   ##
==========================================
- Coverage   52.61%   52.43%   -0.19%     
==========================================
  Files          96       96              
  Lines       12617    12669      +52     
==========================================
+ Hits         6639     6643       +4     
- Misses       5978     6026      +48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
packages/federation-sdk/src/sdk.ts (1)

305-307: Verify that exposing raw event emission is the intended API design.

The emit method exposes the underlying event emitter directly, which allows consumers to emit arbitrary events. While the implementation is technically correct and follows the established delegation pattern, this design choice warrants verification:

  • Flexibility vs. Control: Direct emit access provides maximum flexibility but bypasses the SDK's controlled API surface.
  • Type Safety: Without event name constraints, consumers can emit any event string, which may not be desirable.
  • Alternative: Consider whether specific event-emitting methods (e.g., emitRoomStateChanged, emitMemberJoined) would provide better type safety and API clarity.

Additionally, consider adding JSDoc documentation to describe:

  • What events can/should be emitted
  • When consumers should use this method
  • Expected event payload structures
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c8ff64c and 41f756c.

📒 Files selected for processing (1)
  • packages/federation-sdk/src/sdk.ts (4 hunks)
🔇 Additional comments (3)
packages/federation-sdk/src/sdk.ts (3)

8-8: LGTM!

The import follows the established pattern and is correctly placed among other service imports.


41-41: LGTM!

The constructor parameter follows the established dependency injection pattern using tsyringe.


104-108: LGTM!

The updateMemberProfile method correctly delegates to the room service and follows the established delegation pattern used throughout the SDK.

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.

3 participants