{"record":{"id":"dbfe545d95a0623b","repo":"Hmbown/CodeWhale","slug":"notification-event-list-is-too-large","errorCode":null,"errorMessage":"notification event list is too large","messagePattern":"notification event list is too large","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/config/src/notifications.rs","lineNumber":254,"sourceCode":"                        .context(\"expected sound path string\")?\n                        .to_string()\n                } else {\n                    value.to_string()\n                };\n                anyhow::ensure!(\n                    !value.is_empty()\n                        && 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)","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/config/src/notifications.rs#L236-L272","documentation":"This error is thrown by NotificationConfigUpdate::parse when handling the EventSoundEvents key whose raw string is longer than 1024 characters. The parser bounds the raw text before it re-parses it as a TOML array, preventing unbounded input from being fed into toml::from_str. It is a size guard, not a syntax check.","triggerScenarios":"Calling NotificationConfigUpdate::parse with K::EventSoundEvents and a raw string representation of the array (e.g. \"[\\\"a\\\",\\\"b\\\",...]\") whose length exceeds 1024 bytes.","commonSituations":"A user pastes a very long list of event names into the config; a tool serializes the whole events array with extra whitespace or comments making the raw representation exceed the limit; a long tail of custom event names accumulates over time.","solutions":["Shorten the events array to at most 6 short event names (also required by validation).","Remove whitespace or quoting verbosity so the raw TOML text is within 1024 bytes.","Split the configuration intent — track fewer events instead of a large list.","Check that you are not accidentally embedding the entire config table where only the array is expected."],"exampleFix":"// before\nevent_sound_events = [\"a-very-long-event-name-...\", \"another-long-name\", ...] // >1024 chars\n// after\nevent_sound_events = [\"turn-complete\", \"error\"]","handlingStrategy":"validation","validationCode":"if raw.len() > 1024 { return Err(anyhow::anyhow!(\"event list raw text exceeds 1024 bytes\")); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep event lists short (<=6 names, also enforced later)","Avoid whitespace-heavy formatting of the array","Validate config through the library before saving"],"tags":["config","size-limit","toml"],"backgroundTag":"payload-too-large","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"}