Hmbown/CodeWhale · error
too many notification event names
Error message
too many notification event names
What it means
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.
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.
Example fix
// before event_sound_events = ["e1","e2","e3","e4","e5","e6","e7"] // after event_sound_events = ["e1","e2","e3"]
Defensive patterns
Strategy: validation
Validate before calling
fn valid_event_list(names: &[&str]) -> bool { names.len() <= 6 } Prevention
- Cap UI selections at 6 events
- Deduplicate lists before writing
- Prefer global sound-enabled flags over long event enumerations
When it happens
Trigger: Calling NotificationConfigUpdate::parse with K::EventSoundEvents where the TOML array parses successfully but has 7 or more string elements.
Common situations: 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.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- active profile is missing or malformed
- Cannot export a non-string default_model without losing its…
- Cannot export a root model alias into a non-table provider…
- Cannot export default_model into a non-table provider slot
- config entry must be a string
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/73edf83ca4a36531.
Report an issue: GitHub.
Appendix: source
Thrown at crates/config/src/notifications.rs:261
&& value.len() <= 4096
&& !value.chars().any(char::is_control),
"invalid sound path"
);
Self::SoundFile(PathBuf::from(value))
}
K::Event(event) => Self::Event(event, boolean()?),
K::EventSoundEnabled => Self::EventSoundEnabled(boolean()?),
K::EventSoundQuiet => Self::EventSoundQuiet(boolean()?),
K::EventSoundMinIntervalMs => Self::EventSoundMinIntervalMs(integer()?),
K::EventSoundEvents => {
anyhow::ensure!(raw.len() <= 1024, "notification event list is too large");
let parsed: toml::Table = toml::from_str(&format!("events = {raw}"))
.context("expected TOML notification event array")?;
let values = parsed
.get("events")
.and_then(toml::Value::as_array)
.context("expected notification event array")?;
anyhow::ensure!(values.len() <= 6, "too many notification event names");
let mut events = Vec::new();
for value in values {
let event = value
.as_str()
.and_then(NotificationEvent::parse)
.context("unknown notification event")?;
if !events.iter().any(|value| value == event.as_str()) {
events.push(event.as_str().to_string());
}
}
Self::EventSoundEvents(events)
}
})
}
pub const fn setting(&self) -> NotificationSetting {
use NotificationSetting as K;
match self {
Self::Method(_) => K::Method,View on GitHub (pinned to 73e0f67d83)