Remove debug logging from RRULE handling

Clean up extensive console logging that was added during RRULE debugging.
Removed debug logs from:
- Frontend RRULE generation in create event modal
- Frontend RRULE parsing in calendar service
- Weekly/monthly/yearly occurrence generation functions
- Backend RRULE processing in events and series handlers

The core functionality remains unchanged - this is purely a cleanup
of temporary debugging output that is no longer needed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-08-31 00:35:57 -04:00
parent c599598390
commit 3ccf31f479
4 changed files with 1 additions and 42 deletions

View File

@@ -384,14 +384,9 @@ pub async fn create_event(
}
};
// DEBUG: Log the recurrence field to see what we're receiving
println!("🔍 DEBUG: Received recurrence field: '{}'", request.recurrence);
println!("🔍 DEBUG: Starts with FREQ=? {}", request.recurrence.starts_with("FREQ="));
// Check if recurrence is already a full RRULE or just a simple type
let rrule = if request.recurrence.starts_with("FREQ=") {
// Frontend sent a complete RRULE string, use it directly
println!("🎯 Using complete RRULE from frontend: {}", request.recurrence);
if request.recurrence.is_empty() {
None
} else {
@@ -399,7 +394,6 @@ pub async fn create_event(
}
} else {
// Legacy path: Parse recurrence with BYDAY support for weekly recurrence
println!("🔄 Building RRULE from simple recurrence type: {}", request.recurrence);
match request.recurrence.to_uppercase().as_str() {
"DAILY" => Some("FREQ=DAILY".to_string()),
"WEEKLY" => {

View File

@@ -164,16 +164,13 @@ pub async fn create_event_series(
// Check if recurrence is already a full RRULE or just a simple type
let rrule = if request.recurrence.starts_with("FREQ=") {
// Frontend sent a complete RRULE string, use it directly
println!("🎯 SERIES: Using complete RRULE from frontend: {}", request.recurrence);
request.recurrence.clone()
} else {
// Legacy path: Generate the RRULE for recurrence
println!("🔄 SERIES: Building RRULE from simple recurrence type: {}", request.recurrence);
build_series_rrule_with_freq(&request, recurrence_freq)?
};
event.rrule = Some(rrule);
println!("🔁 Generated RRULE: {:?}", event.rrule);
// Create the event on the CalDAV server
let event_href = client.create_event(&calendar_path, &event)

View File

@@ -387,8 +387,6 @@ impl EventCreationData {
return String::new();
}
web_sys::console::log_1(&format!("🔧 Building RRULE with interval: {}, count: {:?}", self.recurrence_interval, self.recurrence_count).into());
let mut parts = Vec::new();
// Add frequency (required)
@@ -403,9 +401,6 @@ impl EventCreationData {
// Add interval if not 1
if self.recurrence_interval > 1 {
parts.push(format!("INTERVAL={}", self.recurrence_interval));
web_sys::console::log_1(&format!(" Added INTERVAL={}", self.recurrence_interval).into());
} else {
web_sys::console::log_1(&format!("⏭️ Skipped INTERVAL (value is {})", self.recurrence_interval).into());
}
// Add frequency-specific rules
@@ -465,17 +460,11 @@ impl EventCreationData {
if let Some(until_date) = self.recurrence_until {
// Format as UNTIL=YYYYMMDDTHHMMSSZ
parts.push(format!("UNTIL={}T000000Z", until_date.format("%Y%m%d")));
web_sys::console::log_1(&format!(" Added UNTIL={}", until_date).into());
} else if let Some(count) = self.recurrence_count {
parts.push(format!("COUNT={}", count));
web_sys::console::log_1(&format!(" Added COUNT={}", count).into());
} else {
web_sys::console::log_1(&format!("⏭️ No COUNT or UNTIL specified").into());
}
let rrule = parts.join(";");
web_sys::console::log_1(&format!("🎯 Final RRULE: {}", rrule).into());
rrule
parts.join(";")
}
pub fn to_create_event_params(&self) -> (String, String, String, String, String, String, String, bool, String, String, Option<u8>, String, String, String, String, String, Vec<bool>, Option<String>) {

View File

@@ -329,8 +329,6 @@ impl CalendarService {
.unwrap_or(100)
.min(365); // Cap at 365 occurrences for performance
web_sys::console::log_1(&format!("📊 RRULE parsed - FREQ: {}, INTERVAL: {}, COUNT: {}", freq, interval, count).into());
// Get UNTIL date if specified
let until_date = components.get("UNTIL")
.and_then(|until_str| {
@@ -504,7 +502,6 @@ impl CalendarService {
return occurrences;
}
web_sys::console::log_1(&format!("🗓️ Generating WEEKLY BYDAY occurrences for days: {:?}, interval: {}, count: {}", weekdays, interval, count).into());
let start_date = base_event.dtstart.date_naive();
@@ -515,7 +512,6 @@ impl CalendarService {
let mut week_interval_number = 0; // Which interval week we're processing (0, 1, 2, ...)
let max_weeks = (count * 10).min(520); // Prevent infinite loops - max 10 years
web_sys::console::log_1(&format!("📅 Reference week start: {}, event start: {}, INTERVAL: {}", reference_week_start, start_date, interval).into());
// Continue generating until we reach count or date limits
while total_events_generated < count && week_interval_number < max_weeks {
@@ -524,11 +520,9 @@ impl CalendarService {
// Stop if we've gone past the end range
if current_week_start > end_range {
web_sys::console::log_1(&format!("🛑 Week start {} exceeds end range {}", current_week_start, end_range).into());
break;
}
web_sys::console::log_1(&format!("🔄 Processing interval week {} (week start: {}, total events so far: {})", week_interval_number, current_week_start, total_events_generated).into());
// Generate occurrences for all matching weekdays in this week
for &weekday in &weekdays {
@@ -536,13 +530,11 @@ impl CalendarService {
// Skip if occurrence is before start_range or after end_range
if occurrence_date < start_range || occurrence_date > end_range {
web_sys::console::log_1(&format!("⏭️ Skipping {} (outside range {}-{})", occurrence_date, start_range, end_range).into());
continue;
}
// Skip if this occurrence is before the original event date
if occurrence_date < start_date {
web_sys::console::log_1(&format!("⏭️ Skipping {} (before event start {})", occurrence_date, start_date).into());
continue;
}
@@ -585,12 +577,10 @@ impl CalendarService {
}
total_events_generated += 1;
web_sys::console::log_1(&format!("✅ Generated weekly occurrence on {} (event {} of {})", occurrence_date, total_events_generated, count).into());
occurrences.push(occurrence_event);
// Stop if we've reached the count limit
if total_events_generated >= count {
web_sys::console::log_1(&format!("🎯 Reached COUNT limit of {} events", count).into());
return occurrences;
}
}
@@ -600,7 +590,6 @@ impl CalendarService {
week_interval_number += 1;
}
web_sys::console::log_1(&format!("✅ Generated {} total weekly BYDAY occurrences", occurrences.len()).into());
occurrences
}
@@ -627,7 +616,6 @@ impl CalendarService {
return occurrences;
}
web_sys::console::log_1(&format!("📅 Generating MONTHLY BYMONTHDAY occurrences for days: {:?}", monthdays).into());
let start_date = base_event.dtstart.date_naive();
let mut current_month_start = NaiveDate::from_ymd_opt(start_date.year(), start_date.month(), 1).unwrap();
@@ -635,7 +623,6 @@ impl CalendarService {
let mut months_processed = 0;
let max_months = (count * 12).min(120); // Prevent infinite loops - max 10 years
web_sys::console::log_1(&format!("📅 Starting monthly BYMONTHDAY generation from {} with count {} and interval {}", current_month_start, count, interval).into());
// Generate occurrences month by month
while current_month_start <= end_range && total_occurrences < count && months_processed < max_months {
@@ -690,7 +677,6 @@ impl CalendarService {
occurrence_event.dtend = Some(end + Duration::days(days_diff));
}
web_sys::console::log_1(&format!("📅 Generated monthly BYMONTHDAY occurrence on {}", occurrence_date).into());
occurrences.push(occurrence_event);
total_occurrences += 1;
}
@@ -701,13 +687,11 @@ impl CalendarService {
months_processed += 1;
if let Some(next_month_start) = Self::add_months(current_month_start, interval) {
current_month_start = NaiveDate::from_ymd_opt(next_month_start.year(), next_month_start.month(), 1).unwrap();
web_sys::console::log_1(&format!("📅 Advanced to month {} (processed {} months, {} occurrences so far)", current_month_start, months_processed, total_occurrences).into());
} else {
break;
}
}
web_sys::console::log_1(&format!("✅ Generated {} total monthly BYMONTHDAY occurrences", occurrences.len()).into());
occurrences
}
@@ -723,7 +707,6 @@ impl CalendarService {
) -> Vec<VEvent> {
let mut occurrences = Vec::new();
web_sys::console::log_1(&format!("📅 Generating MONTHLY BYDAY occurrences for: {}", byday).into());
// Parse BYDAY for monthly (e.g., "1MO" = first Monday, "-1FR" = last Friday)
if let Some((position, weekday)) = Self::parse_monthly_byday(byday) {
@@ -782,7 +765,6 @@ impl CalendarService {
}
}
web_sys::console::log_1(&format!("✅ Generated {} total monthly BYDAY occurrences", occurrences.len()).into());
occurrences
}
@@ -809,7 +791,6 @@ impl CalendarService {
return occurrences;
}
web_sys::console::log_1(&format!("📅 Generating YEARLY BYMONTH occurrences for months: {:?}", months).into());
let start_date = base_event.dtstart.date_naive();
let mut current_year = start_date.year();
@@ -866,7 +847,6 @@ impl CalendarService {
occurrence_event.dtend = Some(end + Duration::days(days_diff));
}
web_sys::console::log_1(&format!("📅 Generated yearly BYMONTH occurrence on {}", occurrence_date).into());
occurrences.push(occurrence_event);
total_occurrences += 1;
}
@@ -882,7 +862,6 @@ impl CalendarService {
}
}
web_sys::console::log_1(&format!("✅ Generated {} total yearly BYMONTH occurrences", occurrences.len()).into());
occurrences
}