{"record":{"id":"e3fb4cbe08826cd1","repo":"Zackriya-Solutions/meetily","slug":"meeting-reminder-cannot-be-more-than-24-hours-144","errorCode":null,"errorMessage":"Meeting reminder cannot be more than 24 hours (1440 minutes)","messagePattern":"Meeting reminder cannot be more than 24 hours \\(1440 minutes\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"frontend/src-tauri/src/notifications/settings.rs","lineNumber":255,"sourceCode":"        // Perform any necessary migrations here\n        // For example, if we add new settings in the future\n\n        self.save_settings(&settings).await?;\n        Ok(settings)\n    }\n}\n\n/// Get default notification settings\npub fn get_default_settings() -> NotificationSettings {\n    NotificationSettings::default()\n}\n\n/// Validate notification settings\npub fn validate_settings(settings: &NotificationSettings) -> Result<()> {\n    // Validate meeting reminder minutes\n    for &minutes in &settings.notification_preferences.meeting_reminder_minutes {\n        if minutes > 1440 { // More than 24 hours\n            return Err(anyhow!(\"Meeting reminder cannot be more than 24 hours (1440 minutes)\"));\n        }\n    }\n\n    Ok(())\n}\n\n/// Merge settings with defaults (for handling partial updates)\npub fn merge_with_defaults(partial: NotificationSettings) -> NotificationSettings {\n    let _defaults = NotificationSettings::default();\n\n    NotificationSettings {\n        recording_notifications: partial.recording_notifications,\n        time_based_reminders: partial.time_based_reminders,\n        meeting_reminders: partial.meeting_reminders,\n        respect_do_not_disturb: partial.respect_do_not_disturb,\n        notification_sound: partial.notification_sound,\n        system_permission_granted: partial.system_permission_granted,\n        consent_given: partial.consent_given,","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/Zackriya-Solutions/meetily/blob/0281737d87d26352fb0adc78c8c0975f691b23d1/frontend/src-tauri/src/notifications/settings.rs#L237-L273","documentation":"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.","triggerScenarios":"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.","commonSituations":"Settings import/restore from another machine; frontend unit bugs; manual JSON edits.","solutions":["Clamp values to 0..=1440 at the input boundary (UI form / merge_with_defaults) before validation","When importing settings, sanitize each reminder value on load","Fix unit mismatches (hours vs minutes) in the UI layer"],"exampleFix":"// before\nfor &minutes in &settings.notification_preferences.meeting_reminder_minutes {\n    if minutes > 1440 {\n        return Err(anyhow!(\"Meeting reminder cannot be more than 24 hours (1440 minutes)\"));\n    }\n}\n\n// after - sanitize at the boundary so validate_settings never sees out-of-range input\npub fn sanitize_settings(settings: &mut NotificationSettings) {\n    for minutes in settings.notification_preferences.meeting_reminder_minutes.iter_mut() {\n        *minutes = (*minutes).clamp(0, 1440);\n    }\n}\nsanitize_settings(&mut settings);\nvalidate_settings(&settings)?;","handlingStrategy":"validation","validationCode":"// Clamp before validate\nfn sanitize_reminders(s: &mut NotificationSettings) {\n    for m in s.notification_preferences.meeting_reminder_minutes.iter_mut() {\n        *m = (*m).clamp(0, 1440);\n    }\n}","typeGuard":"fn is_valid_settings(s: &NotificationSettings) -> bool {\n    s.notification_preferences\n        .meeting_reminder_minutes\n        .iter()\n        .all(|&m| m <= 1440)\n}","tryCatchPattern":null,"preventionTips":["Validate at the input boundary, not only before persist","Cap the UI control at 1440 minutes","Sanitize imported settings files field-by-field"],"tags":["validation","notifications","settings","range-check"],"backgroundTag":"settings-validation-failed","analyzedSha":"0281737d87d26352fb0adc78c8c0975f691b23d1","analyzedAt":"2026-08-16T20:57:52.567Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}