Code Review Bench PR #26775 - fix(companion): event type links for org user#5
Code Review Bench PR #26775 - fix(companion): event type links for org user#5ketkarameya wants to merge 7 commits intobase_pr_26775_20260125_6368from
Conversation
Addresses Cubic AI review feedback (confidence 9/10): The username was hardcoded to 'username' but still used by BasicsTab as a fallback for URL display when bookingUrl is unavailable. This restores the useEffect that fetches the actual username from CalComAPIService.getUsername(). Co-Authored-By: unknown <>
| const [conferencingOptions, setConferencingOptions] = useState<ConferencingOption[]>([]); | ||
| const [conferencingLoading, setConferencingLoading] = useState(false); | ||
| const [eventTypeData, setEventTypeData] = useState<EventType | null>(null); | ||
| const [bookingUrl, setBookingUrl] = useState<string>(""); |
There was a problem hiding this comment.
🚨 Bug: setBookingUrl is never called — preview/copy always fails
In event-type-detail.tsx, the bookingUrl state is initialized as an empty string ("") on line 180, but setBookingUrl is never called anywhere in the component. This means bookingUrl will always be "" (falsy), so:
handlePreviewwill always show "Booking URL not available. Please save the event type first." and return early.handleCopyLinkwill always show the same error and return early.BasicsTabreceivesbookingUrl=""which is falsy, so it falls back to the oldcal.com/{username}/display.
The component loads event type data into eventTypeData state (line 179), which should contain bookingUrl from the API. There needs to be a call like setBookingUrl(eventTypeData.bookingUrl || "") in the effect that processes the loaded event type data, or bookingUrl should be read directly from eventTypeData?.bookingUrl instead of duplicating it into separate state.
Was this helpful? React with 👍 / 👎
- Apply suggested fix
| const bookingUrl = `https://cal.com/${ | ||
| eventType.users?.[0]?.username || "user" | ||
| }/${eventType.slug}`; | ||
| const bookingUrl = |
There was a problem hiding this comment.
⚠️ Bug: First copy button handler in content.ts not updated to use bookingUrl
In content.ts, there are two copy button click handlers. The first one (line 1125-1128) was NOT updated to use eventType.bookingUrl — it still always constructs the URL using the old https://cal.com/{username}/{slug} pattern. The second handler (line 1871-1873) was correctly updated with the fallback pattern.
This means organization users clicking the copy button in the first UI context (appears to be the general web integration) will still get incorrect URLs, defeating the purpose of this PR.
Fix: Update the first copy handler to match the pattern used everywhere else:
const bookingUrl =
eventType.bookingUrl ||
`https://cal.com/${eventType.users?.[0]?.username || "user"}/${eventType.slug}`;Was this helpful? React with 👍 / 👎
| const bookingUrl = | |
| const bookingUrl = | |
| eventType.bookingUrl || | |
| `https://cal.com/${ | |
| eventType.users?.[0]?.username || "user" | |
| }/${eventType.slug}`; |
- Apply suggested fix
There was a problem hiding this comment.
Configure merge blocking · Maintainers can dismiss this review. Gitar never approves changes.
Code Review 🚫 Blocked 0 resolved / 3 findingsCritical: 🚨 Bug:
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
Benchmark Evaluation ResultsGround Truth Bugs (Recall: 3/4 = 75.0%)
Extra Gitar Findings
Summary
|
Benchmark PR for Gitar evaluation
Original PR: agentic-review-benchmarks#5
fix(companion): event type links for org user
Summary by Gitar
cal.com/{username}/{slug}) doesn't account for custom domains or org-specific URL patternsbookingUrlfield instead of building URLs client-side, with fallback to original pattern for backward compatibilitybookingUrlbookingUrlas optional field to EventType interface, removed obsoletebuildEventTypeLink()method from CalComAPIService