{"record":{"id":"73edf83ca4a36531","repo":"Hmbown/CodeWhale","slug":"too-many-notification-event-names","errorCode":null,"errorMessage":"too many notification event names","messagePattern":"too many notification event names","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/config/src/notifications.rs","lineNumber":261,"sourceCode":"                        && value.len() <= 4096\n                        && !value.chars().any(char::is_control),\n                    \"invalid sound path\"\n                );\n                Self::SoundFile(PathBuf::from(value))\n            }\n            K::Event(event) => Self::Event(event, boolean()?),\n            K::EventSoundEnabled => Self::EventSoundEnabled(boolean()?),\n            K::EventSoundQuiet => Self::EventSoundQuiet(boolean()?),\n            K::EventSoundMinIntervalMs => Self::EventSoundMinIntervalMs(integer()?),\n            K::EventSoundEvents => {\n                anyhow::ensure!(raw.len() <= 1024, \"notification event list is too large\");\n                let parsed: toml::Table = toml::from_str(&format!(\"events = {raw}\"))\n                    .context(\"expected TOML notification event array\")?;\n                let values = parsed\n                    .get(\"events\")\n                    .and_then(toml::Value::as_array)\n                    .context(\"expected notification event array\")?;\n                anyhow::ensure!(values.len() <= 6, \"too many notification event names\");\n                let mut events = Vec::new();\n                for value in values {\n                    let event = value\n                        .as_str()\n                        .and_then(NotificationEvent::parse)\n                        .context(\"unknown notification event\")?;\n                    if !events.iter().any(|value| value == event.as_str()) {\n                        events.push(event.as_str().to_string());\n                    }\n                }\n                Self::EventSoundEvents(events)\n            }\n        })\n    }\n    pub const fn setting(&self) -> NotificationSetting {\n        use NotificationSetting as K;\n        match self {\n            Self::Method(_) => K::Method,","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/config/src/notifications.rs#L243-L279","documentation":"This error is thrown by NotificationConfigUpdate::parse when the parsed EventSoundEvents TOML array contains more than 6 entries. After re-parsing the raw text as a TOML table, the code enforces a hard cap of 6 event names per notification setting. The limit keeps the notification config bounded and canonical.","triggerScenarios":"Calling NotificationConfigUpdate::parse with K::EventSoundEvents where the TOML array parses successfully but has 7 or more string elements.","commonSituations":"A user subscribes sound notifications to every event the system offers; an editor or script appends event names cumulatively without deduplication, eventually exceeding the cap.","solutions":["Reduce the list to at most 6 event names, keeping the most important ones.","Deduplicate the list first — repeated names count toward the limit.","Use wildcards/global sound-enabled settings (EventSoundEnabled) instead of enumerating many events individually.","Use only recognized event names (those accepted by NotificationEvent::parse); unknown names fail the next step anyway."],"exampleFix":"// before\nevent_sound_events = [\"e1\",\"e2\",\"e3\",\"e4\",\"e5\",\"e6\",\"e7\"]\n// after\nevent_sound_events = [\"e1\",\"e2\",\"e3\"]","handlingStrategy":"validation","validationCode":"fn valid_event_list(names: &[&str]) -> bool { names.len() <= 6 }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap UI selections at 6 events","Deduplicate lists before writing","Prefer global sound-enabled flags over long event enumerations"],"tags":["config","limit","toml"],"backgroundTag":"value-out-of-range","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}