Clean up debug logging and fix compiler warnings

- Remove non-critical debug logs from backend CalDAV parsing
- Remove all-day event debug logs from frontend components
- Fix unused variable warnings with underscore prefixes
- Keep essential logging while reducing noise

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Connor Johnstone
2025-09-18 16:02:41 -04:00
parent 5854ad291d
commit 703c9ee2f5
5 changed files with 11 additions and 67 deletions

View File

@@ -348,11 +348,6 @@ impl CalDAVClient {
}
full_prop.push_str(&format!(":{}", prop_value));
// Debug logging for DTSTART properties specifically
if prop_name == "DTSTART" {
println!("🔍 Raw DTSTART property: name='{}', value='{}', params={:?}, full_prop='{}'",
property.name, prop_value, property.params, full_prop);
}
full_properties.insert(prop_name, full_prop);
}
@@ -369,14 +364,6 @@ impl CalDAVClient {
let dtstart_value = properties.get("DTSTART").unwrap_or(&empty_string);
let all_day = dtstart_raw.contains("VALUE=DATE") || (!dtstart_value.contains("T") && dtstart_value.len() == 8);
// Debug logging for DTSTART parsing
if all_day {
println!("✅ ALL-DAY EVENT FOUND: DTSTART='{}' -> all_day={}", dtstart_raw, all_day);
} else {
println!("🔍 Backend: DTSTART='{}' (len={}, has_T={}, has_VALUE_DATE={}) -> all_day={}",
dtstart_raw, dtstart_raw.len(), dtstart_raw.contains("T"),
dtstart_raw.contains("VALUE=DATE"), all_day);
}
// Parse start time (required)
let start_prop = properties
@@ -486,14 +473,6 @@ impl CalDAVClient {
vevent.exdate = exdate.into_iter().map(|dt| dt.naive_utc()).collect();
vevent.exdate_tzid = None; // TODO: Parse timezone info for EXDATE
vevent.all_day = all_day;
if all_day {
println!("📅 Backend: Successfully created all-day VEvent '{}' with start={}, end={:?}, all_day={}",
vevent.summary.as_ref().unwrap_or(&"Untitled".to_string()),
vevent.dtstart,
vevent.dtend,
vevent.all_day
);
}
// Parse alarms
vevent.alarms = self.parse_valarms(&event)?;
@@ -625,7 +604,7 @@ impl CalDAVClient {
has_valid_caldav_response = true;
all_calendars.extend(calendars);
}
Err(CalDAVError::ServerError(status)) => {
Err(CalDAVError::ServerError(_status)) => {
// HTTP error - this might be expected for some paths, continue trying
}
Err(e) => {

View File

@@ -491,26 +491,18 @@ fn deduplicate_events(mut events: Vec<VEvent>) -> Vec<VEvent> {
let mut uid_groups: HashMap<String, Vec<VEvent>> = HashMap::new();
for event in events.drain(..) {
// Debug logging to understand what's happening
println!("🔍 Event: '{}' at {} (RRULE: {}) - UID: {}",
event.summary.as_ref().unwrap_or(&"No Title".to_string()),
event.dtstart.format("%Y-%m-%d %H:%M"),
if event.rrule.is_some() { "Yes" } else { "No" },
event.uid
);
uid_groups.entry(event.uid.clone()).or_insert_with(Vec::new).push(event);
}
let mut uid_deduplicated_events = Vec::new();
for (uid, mut events_with_uid) in uid_groups.drain() {
for (_uid, mut events_with_uid) in uid_groups.drain() {
if events_with_uid.len() == 1 {
// Only one event with this UID, keep it
uid_deduplicated_events.push(events_with_uid.into_iter().next().unwrap());
} else {
// Multiple events with same UID - prefer recurring over non-recurring
println!("🔍 Found {} events with UID '{}'", events_with_uid.len(), uid);
// Sort by preference: recurring events first, then by completeness
events_with_uid.sort_by(|a, b| {
@@ -529,10 +521,6 @@ fn deduplicate_events(mut events: Vec<VEvent>) -> Vec<VEvent> {
// Keep the first (preferred) event
let preferred_event = events_with_uid.into_iter().next().unwrap();
println!("🔄 UID dedup: Keeping '{}' (RRULE: {})",
preferred_event.summary.as_ref().unwrap_or(&"No Title".to_string()),
if preferred_event.rrule.is_some() { "Yes" } else { "No" }
);
uid_deduplicated_events.push(preferred_event);
}
}