Skip to content

Comments

feat: update recording, transcript endpoint and add tests #79

Open
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_feat_update_recording_transcript_endpoint_and_add_tests__pr692from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_feat_update_recording_transcript_endpoint_and_add_tests__pr692
Open

feat: update recording, transcript endpoint and add tests #79
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_feat_update_recording_transcript_endpoint_and_add_tests__pr692from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_feat_update_recording_transcript_endpoint_and_add_tests__pr692

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 21, 2026

Benchmark PR from qodo-benchmark#692


Note

Strengthens access control and aligns response types for media-related booking endpoints.

  • Auth/PBAC enforcement: GET /v2/bookings/:bookingUid/recordings now uses @Pbac(["booking.readRecordings"]), requires @Permissions([BOOKING_WRITE]), and guards ApiAuthGuard, BookingUidGuard, BookingPbacGuard; GET /:bookingUid/transcripts adds PBAC and guarded by BookingPbacGuard, ApiAuthGuard, BookingUidGuard (keeps BOOKING_READ).
  • Response shape cleanup: Removes message field from GetBookingRecordingsOutput and GetBookingTranscriptsOutput.
  • Tests: Adds e2e authorization tests for recordings and transcripts (organizer allowed; unauthorized receives 403).
  • Minor: getBookingRecordings no longer awaits calVideoService.getRecordings().

Written by Cursor Bugbot for commit d18708a. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

})
async getBookingRecordings(@Param("bookingUid") bookingUid: string): Promise<GetBookingRecordingsOutput> {
const recordings = await this.calVideoService.getRecordings(bookingUid);
const recordings = this.calVideoService.getRecordings(bookingUid);
Copy link

Choose a reason for hiding this comment

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

Missing await causes Promise returned instead of recordings

High Severity

The await keyword was removed from the this.calVideoService.getRecordings(bookingUid) call, but getRecordings is an async method. Without await, the recordings variable holds a Promise instead of the resolved array, causing the API to return a Promise object in the response data field rather than the actual recordings.

Fix in Cursor Fix in Web

@Permissions([BOOKING_READ])
@UseGuards(BookingUidGuard)
// @UseGuards(ApiAuthGuard, BookingUidGuard, BookingPbacGuard)
@UseGuards(BookingPbacGuard, ApiAuthGuard, BookingUidGuard)
Copy link

Choose a reason for hiding this comment

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

Incorrect guard order causes unauthorized error on transcripts

High Severity

The UseGuards decorator for the transcripts endpoint has BookingPbacGuard listed before ApiAuthGuard, but BookingPbacGuard requires request.user which is set by ApiAuthGuard. This incorrect order causes the guard to always throw UnauthorizedException because the user isn't authenticated yet when BookingPbacGuard runs.

Fix in Cursor Fix in Web

@UseGuards(BookingUidGuard)
// @UseGuards(ApiAuthGuard, BookingUidGuard, BookingPbacGuard)
@Pbac(["booking.readRecordings"])
@Permissions([BOOKING_WRITE])
Copy link

Choose a reason for hiding this comment

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

Recordings endpoint incorrectly requires write permission for read

Medium Severity

The recordings GET endpoint was changed from BOOKING_READ to BOOKING_WRITE permission, but this is inconsistent with similar endpoints. The transcripts and conferencing-sessions GET endpoints both use BOOKING_READ, and all three share the same @Pbac(["booking.readRecordings"]) decorator indicating a read operation. Users with read-only access can view transcripts but are unexpectedly blocked from viewing recordings.

Fix in Cursor Fix in Web

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