Skip to content

Conversation

@jzunigax2
Copy link
Contributor

@jzunigax2 jzunigax2 commented Aug 1, 2025

Implemented jitsi's webhook to handle user disconnects. More info here

- Added `JitsiWebhookModule` to manage Jitsi webhook events.
- Implemented `JitsiWebhookController` to handle incoming webhook requests, specifically for `PARTICIPANT_LEFT` events.
- Created `JitsiWebhookService` to process participant left events and interact with room management.
- Introduced interfaces for Jitsi webhook payloads to ensure type safety.
- Enhanced unit tests for the webhook service and controller to validate functionality and error handling.
- Updated `package.json` to include `body-parser` dependency for request handling.
@jzunigax2 jzunigax2 requested a review from xabg2 August 1, 2025 06:26
@jzunigax2 jzunigax2 self-assigned this Aug 1, 2025
@jzunigax2 jzunigax2 added the enhancement New feature or request label Aug 1, 2025

async createCallToken(userUuid: string) {
const meetFeatures = await this.getMeetFeatureConfigForUser(userUuid);
async createCallToken(user: User | UserTokenData['payload']) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, what is the difference between User and UserTokenData['payload]? Is it the same? Or User is for authenticated users and UserTokenData['payload'] is for anonymous users?

service = module.get<JitsiWebhookService>(JitsiWebhookService);

// Mock logger
jest.spyOn(Logger.prototype, 'log').mockImplementation(() => undefined);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of mocking the logger globally, perhaps you could spy on it each time you print a log, so you can verify that the printed message is what we want.


if (!roomId) {
this.logger.warn(`Could not extract room ID from FQN: ${payload.fqn}`);
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe throwing an error explaining what happens? Or we do not want that?


if (!participantId) {
this.logger.warn('Participant ID not found in payload');
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here


if (!room) {
this.logger.warn(`Room with ID ${roomId} not found`);
return;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here.

@CandelR CandelR self-assigned this Sep 8, 2025
@CandelR CandelR marked this pull request as ready for review September 8, 2025 15:30
@CandelR CandelR merged commit f172e70 into master Sep 12, 2025
3 of 5 checks passed
@CandelR CandelR deleted the feat/jaas-webhook branch September 12, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants