Zackriya-Solutions/meetily · error · anyhow::Error

Meeting reminder cannot be more than 24 hours (1440 minutes)

Error message

Meeting reminder cannot be more than 24 hours (1440 minutes)

What it means

validate_settings rejected the settings because at least one value in notification_preferences.meeting_reminder_minutes exceeds 1440 (24 hours). This is deliberate input validation, not a system fault - persisted or imported settings contain an out-of-range reminder.

Source

Thrown at frontend/src-tauri/src/notifications/settings.rs:255

        // Perform any necessary migrations here
        // For example, if we add new settings in the future

        self.save_settings(&settings).await?;
        Ok(settings)
    }
}

/// Get default notification settings
pub fn get_default_settings() -> NotificationSettings {
    NotificationSettings::default()
}

/// Validate notification settings
pub fn validate_settings(settings: &NotificationSettings) -> Result<()> {
    // Validate meeting reminder minutes
    for &minutes in &settings.notification_preferences.meeting_reminder_minutes {
        if minutes > 1440 { // More than 24 hours
            return Err(anyhow!("Meeting reminder cannot be more than 24 hours (1440 minutes)"));
        }
    }

    Ok(())
}

/// Merge settings with defaults (for handling partial updates)
pub fn merge_with_defaults(partial: NotificationSettings) -> NotificationSettings {
    let _defaults = NotificationSettings::default();

    NotificationSettings {
        recording_notifications: partial.recording_notifications,
        time_based_reminders: partial.time_based_reminders,
        meeting_reminders: partial.meeting_reminders,
        respect_do_not_disturb: partial.respect_do_not_disturb,
        notification_sound: partial.notification_sound,
        system_permission_granted: partial.system_permission_granted,
        consent_given: partial.consent_given,

View on GitHub (pinned to 0281737d87)

Solutions

  1. Clamp values to 0..=1440 at the input boundary (UI form / merge_with_defaults) before validation
  2. When importing settings, sanitize each reminder value on load
  3. Fix unit mismatches (hours vs minutes) in the UI layer

Example fix

// before
for &minutes in &settings.notification_preferences.meeting_reminder_minutes {
    if minutes > 1440 {
        return Err(anyhow!("Meeting reminder cannot be more than 24 hours (1440 minutes)"));
    }
}

// after - sanitize at the boundary so validate_settings never sees out-of-range input
pub fn sanitize_settings(settings: &mut NotificationSettings) {
    for minutes in settings.notification_preferences.meeting_reminder_minutes.iter_mut() {
        *minutes = (*minutes).clamp(0, 1440);
    }
}
sanitize_settings(&mut settings);
validate_settings(&settings)?;
Defensive patterns

Strategy: validation

Validate before calling

// Clamp before validate
fn sanitize_reminders(s: &mut NotificationSettings) {
    for m in s.notification_preferences.meeting_reminder_minutes.iter_mut() {
        *m = (*m).clamp(0, 1440);
    }
}

Type guard

fn is_valid_settings(s: &NotificationSettings) -> bool {
    s.notification_preferences
        .meeting_reminder_minutes
        .iter()
        .all(|&m| m <= 1440)
}

Prevention

When it happens

Trigger: Calling validate_settings after importing a settings JSON with e.g. 2880 minutes, a UI sending hours where minutes are expected, or a partial-update merge that never clamps user input.

Common situations: Settings import/restore from another machine; frontend unit bugs; manual JSON edits.

Related errors


AI-assisted analysis of Zackriya-Solutions/meetily@0281737d87 (2026-08-16). Data as JSON: /api/errors/e3fb4cbe08826cd1. Report an issue: GitHub.