fix(companion): event type links for org user#68
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 <>
There was a problem hiding this comment.
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.
| 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.
bookingUrl state is never populated from API data
High Severity
The bookingUrl state is initialized to an empty string but setBookingUrl is never called. The applyEventTypeData function loads many fields from the API response but never sets bookingUrl from eventType.bookingUrl. This causes handlePreview and handleCopyLink to always fail with "Booking URL not available" since the empty string is falsy.
Additional Locations (1)
| const bookingUrl = | ||
| `https://cal.com/${ | ||
| eventType.users?.[0]?.username || "user" | ||
| }/${eventType.slug}`; |
There was a problem hiding this comment.
Gmail copy button missing bookingUrl fallback logic
Medium Severity
The Gmail integration's copy button handler constructs the booking URL directly without checking eventType.bookingUrl first. The preview button handler was correctly updated to use eventType.bookingUrl || fallback, but the copy button was not, causing inconsistent behavior for org users.
| if (!eventType.bookingUrl) { | ||
| showErrorAlert("Error", "Booking URL not available for this event type."); | ||
| return; | ||
| } |
There was a problem hiding this comment.
Mobile app handlers lack fallback URL unlike extension
Medium Severity
The mobile app's handleCopyLink, _handleShare, and handlePreview functions show an error and return early if eventType.bookingUrl is missing, with no fallback URL construction. The extension code uses eventType.bookingUrl || fallbackUrl pattern. Since bookingUrl is optional in the type definition, event types without this field will fail in the mobile app but work in the extension. Previously, CalComAPIService.buildEventTypeLink() always generated a URL.
Benchmark PR from qodo-benchmark#706
Note
Use API
bookingUrlfor event type linksbookingUrlthroughEventTypetypes and components (lists, detail, Basics tab) and displays URL prefix derived from itbookingUrl; shows errors when absentbookingUrlfor preview/copy/insert with slug fallback; caches and type annotations updatedbuildEventTypeLinkusage from services and screens; addsgetUsernamehelper (no longer used for link building)UI/Styling polish
Written by Cursor Bugbot for commit 4f49041. Configure here.