Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile OverviewGreptile SummaryThis PR adds comprehensive Cal.com integration to the Sim platform, enabling users to manage bookings, event types, and schedules through 20 new tools and 9 webhook triggers. Key Changes:
Integration Architecture: Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant SimUI as Sim UI
participant SimBackend as Sim Backend
participant CalCom as Cal.com API
participant Webhook as Webhook Handler
Note over User,CalCom: OAuth Authentication Flow
User->>SimUI: Connect Cal.com account
SimUI->>SimBackend: Initiate OAuth (PKCE)
SimBackend->>CalCom: Authorization request
CalCom->>User: Login & consent
User->>CalCom: Approve
CalCom->>SimBackend: Authorization code
SimBackend->>CalCom: Exchange code for tokens
CalCom->>SimBackend: Access token + refresh token
SimBackend->>SimBackend: Encrypt & store tokens
SimBackend->>SimUI: OAuth complete
Note over User,CalCom: Tool Execution (e.g., Create Booking)
User->>SimUI: Configure booking details
SimUI->>SimBackend: Execute create_booking tool
SimBackend->>SimBackend: Decrypt access token
SimBackend->>SimBackend: Check token expiry
alt Token expired
SimBackend->>CalCom: Refresh token request
CalCom->>SimBackend: New access token
SimBackend->>SimBackend: Update stored token
end
SimBackend->>CalCom: POST /v2/bookings
CalCom->>SimBackend: Booking created response
SimBackend->>SimUI: Return booking data
Note over User,Webhook: Webhook Trigger Flow
User->>SimUI: Configure booking_created trigger
SimUI->>SimBackend: Save trigger with webhook URL
User->>CalCom: Configure webhook in Cal.com
CalCom->>Webhook: POST webhook event (X-Cal-Signature-256)
Webhook->>Webhook: Validate HMAC signature (timing-safe)
alt Signature valid
Webhook->>SimBackend: Process webhook payload
SimBackend->>SimBackend: Execute workflow
Webhook->>CalCom: 200 OK
else Invalid signature
Webhook->>CalCom: 401 Unauthorized
end
|
- Add flatTagIndexMap for O(1) tag lookups (replaces O(n²) findIndex calls) - Memoize caret position calculation to avoid DOM manipulation on every render - Use refs for inputValue/cursorPosition to keep handleTagSelect callback stable - Change itemRefs from index-based to tag-based keys to prevent stale refs - Fix scroll jump in nested folders by removing scroll reset from registerFolder - Add onFolderEnter callback for scroll reset when entering folder via keyboard - Disable keyboard navigation wrap-around at boundaries - Simplify selection reset to single effect on flatTagList.length change Also: - Add safeCompare utility for timing-safe string comparison - Refactor webhook signature validation to use safeCompare Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
Author
|
@greptile |
The condition field already restricts these to calcom_create_booking, so simplified to required: true. Per Cal.com API docs, email is optional while name and timeZone are required. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
…xt subblock styling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Type of Change
Testing
Tested manually
Checklist