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

@@ -328,8 +328,6 @@ impl CalendarService {
.and_then(|s| s.parse().ok())
.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")
@@ -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
}