-
Notifications
You must be signed in to change notification settings - Fork 144
participants based invitees #1044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes introduce participant management for calendar events across Apple, Google, and Outlook integrations. A new Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant TauriCmd
participant PluginExt
participant SyncModule
participant CalendarAPI
participant DB
UI->>TauriCmd: sync_session_participants(session_id)
TauriCmd->>PluginExt: sync_session_participants(session_id)
PluginExt->>SyncModule: sync_session_participants(db, session_id)
SyncModule->>DB: fetch linked event for session_id
SyncModule->>CalendarAPI: get_event_participants(event_tracking_id)
CalendarAPI-->>SyncModule: Vec<Participant>
loop for each Participant
SyncModule->>DB: get_human_by_email(participant.email)
alt Human exists
SyncModule->>DB: update Human record
else Human missing
SyncModule->>DB: create new Human record
end
SyncModule->>DB: associate Human as session participant
end
SyncModule-->>PluginExt: Result
PluginExt-->>TauriCmd: Result
TauriCmd-->>UI: Result
sequenceDiagram
participant App
participant CalendarSource
participant CalendarProvider
App->>CalendarSource: get_event_participants(event_tracking_id)
CalendarSource->>CalendarProvider: fetch event by ID
CalendarProvider-->>CalendarSource: event (with attendees)
CalendarSource-->>App: Vec<Participant>
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes detected. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Clippy (1.86.0)
error: failed to load source for dependency Caused by: Caused by: Caused by: 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used📓 Path-based instructions (1)`**/*.{js,ts,tsx,rs}`: 1. No error handling. 2. No unused imports, variables, or functions. 3. For comments, keep it minimal. It should be about "Why", not "What".
⚙️ Source: CodeRabbit Configuration File List of files the instruction was applied to:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (3)
crates/db-user/src/events_ops.rs (1)
144-147
: Consider if the helper method adds sufficient value.The
deserialize_event_from_row
method is currently just a thin wrapper aroundlibsql::de::from_row
. While it centralizes the logic, it doesn't add significant functionality. Consider whether this abstraction is necessary unless you plan to add additional processing logic in the future.crates/calendar-google/src/lib.rs (1)
114-150
: Consider performance optimization for calendar search.The current implementation searches through all calendars sequentially, which could be inefficient if a user has many calendars. However, this approach aligns with the implementations in the Apple and Outlook calendar crates.
If performance becomes an issue in production, consider implementing a caching mechanism or allowing the caller to provide a hint about which calendar contains the event.
plugins/apple-calendar/src/sync.rs (1)
370-377
: Remove redundant warning log.The error is both logged as a warning and returned, which is redundant since the caller will likely log or handle the error.
- Err(e) => { - tracing::warn!( - "Failed to get calendar event participants for tracking_id {}: {}", - event.tracking_id, - e - ); - return Err(e); - } + Err(e) => { + return Err(e); + }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
📒 Files selected for processing (14)
crates/calendar-apple/src/lib.rs
(2 hunks)crates/calendar-google/src/lib.rs
(1 hunks)crates/calendar-interface/src/lib.rs
(1 hunks)crates/calendar-outlook/Cargo.toml
(1 hunks)crates/calendar-outlook/src/lib.rs
(2 hunks)crates/db-user/src/events_migration_1.sql
(1 hunks)crates/db-user/src/events_ops.rs
(3 hunks)crates/db-user/src/events_types.rs
(1 hunks)crates/db-user/src/humans_ops.rs
(1 hunks)crates/db-user/src/lib.rs
(2 hunks)crates/db-user/src/sessions_ops.rs
(1 hunks)plugins/apple-calendar/src/commands.rs
(1 hunks)plugins/apple-calendar/src/ext.rs
(2 hunks)plugins/apple-calendar/src/sync.rs
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,ts,tsx,rs}`: 1. No error handling. 2. No unused imports, variables, or functions. 3. For comments, keep it minimal. It should be about "Why", not "What".
**/*.{js,ts,tsx,rs}
: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".
⚙️ Source: CodeRabbit Configuration File
List of files the instruction was applied to:
crates/calendar-interface/src/lib.rs
plugins/apple-calendar/src/commands.rs
crates/db-user/src/lib.rs
crates/db-user/src/humans_ops.rs
crates/db-user/src/events_types.rs
crates/db-user/src/events_ops.rs
crates/calendar-google/src/lib.rs
crates/db-user/src/sessions_ops.rs
plugins/apple-calendar/src/ext.rs
crates/calendar-apple/src/lib.rs
crates/calendar-outlook/src/lib.rs
plugins/apple-calendar/src/sync.rs
🧬 Code Graph Analysis (2)
crates/calendar-google/src/lib.rs (3)
crates/calendar-outlook/src/lib.rs (1)
get_event_participants
(25-70)crates/calendar-interface/src/lib.rs (1)
get_event_participants
(10-13)crates/calendar-apple/src/lib.rs (1)
get_event_participants
(302-320)
crates/calendar-outlook/src/lib.rs (3)
crates/calendar-google/src/lib.rs (3)
get_event_participants
(114-150)event
(88-95)event
(131-138)crates/calendar-interface/src/lib.rs (1)
get_event_participants
(10-13)crates/calendar-apple/src/lib.rs (1)
get_event_participants
(302-320)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: ci (macos, macos-latest)
- GitHub Check: ci
- GitHub Check: ci (windows, windows-latest)
🔇 Additional comments (14)
crates/calendar-outlook/Cargo.toml (1)
10-10
: LGTM! Dependency addition is appropriate.The
serde_json
workspace dependency is correctly added to support JSON parsing for the new participant retrieval functionality.crates/db-user/src/events_migration_1.sql (1)
1-4
: LGTM! Migration is correctly structured.The migration properly adds a
participants
column with appropriate type, default value, and constraints to support the new participant functionality.crates/db-user/src/events_types.rs (1)
5-10
: LGTM! Well-designed participant structure.The
Participant
struct is appropriately designed with mandatory name and optional email fields, following established patterns in the codebase.crates/db-user/src/humans_ops.rs (1)
16-27
: LGTM! Method follows established patterns correctly.The
get_human_by_email
method is well-implemented, following the same secure pattern as the existingget_human
method with proper parameterized queries and consistent error handling.crates/db-user/src/lib.rs (2)
132-132
: LGTM! Migration array correctly updated.The array size is properly incremented to reflect the addition of the new migration file.
151-151
: LGTM! New migration correctly appended.The new migration file is properly added at the end of the array, following the append-only pattern for database migrations.
crates/calendar-interface/src/lib.rs (1)
10-13
: LGTM! Trait method addition follows established patterns.The new
get_event_participants
method signature is consistent with other async trait methods and properly defines the interface for participant retrieval across different calendar providers.crates/db-user/src/sessions_ops.rs (1)
95-106
: LGTM! Good refactoring that eliminates redundant conversions.Extracting the session ID into a variable improves readability and prevents duplicate conversions. The comment provides helpful context about the separation of participant management concerns.
plugins/apple-calendar/src/commands.rs (1)
61-70
: LGTM! Command implementation follows established patterns.The new
sync_session_participants
command is consistent with other commands in the file, using the same annotations and error handling approach.crates/calendar-outlook/src/lib.rs (1)
3-3
: Verify the Participant import is used correctly.The import looks correct and is used in the implementation below.
plugins/apple-calendar/src/ext.rs (1)
15-18
: LGTM!The new
sync_session_participants
method follows the established pattern of other sync methods in this trait. The implementation properly handles database state locking and error propagation.Also applies to: 145-154
crates/calendar-apple/src/lib.rs (2)
135-179
: Consider the implications of the ±365 day search range.The method searches for events within a hardcoded ±365 day range. This could miss events that fall outside this window.
Is this date range limitation intentional? If events can exist beyond this range, consider:
- Making the range configurable
- Using a wider range
- Documenting this limitation
- (chrono::Utc::now() - chrono::Duration::days(365)).timestamp() as f64, + // Search within a 2-year window to ensure we don't miss events + (chrono::Utc::now() - chrono::Duration::days(730)).timestamp() as f64,
302-320
: Implementation follows established patterns.The
get_event_participants
method properly checks calendar access and handles the case when an event is not found by returning an empty vector.plugins/apple-calendar/src/sync.rs (1)
311-324
: Well-structured participant synchronization implementation.The implementation properly handles:
- Creating new humans or updating existing ones based on email
- Database error propagation
- Proper abstraction with the helper function
Also applies to: 325-382
fixes #877