jdx/mise · error
notifications disabled
Error message
notifications disabled
What it means
A test panic used as a spy assertion in src/system/history/sync/run.rs: the closure passed to `notify_conflicts_with` panics with 'notifications disabled' if it is ever invoked. The test verifies that when the `false` flag disables notifications, conflicts are recorded (`conflict_pause_observed`) but the notify callback is never called.
Source
Thrown at src/system/history/sync/run.rs:1252
],
..Default::default()
};
notify_conflicts_with(&mut status, true, |_, body| {
assert!(body.contains("… and 1 other file"));
assert!(body.contains("Local saves still work."));
assert!(body.ends_with("mise bootstrap dotfiles status"));
assert_eq!(body.lines().count(), 3);
assert!(body.chars().count() < 250);
});
}
#[test]
fn explicit_opt_out_is_preserved() {
let mut status = SyncStatus {
conflicts: vec![conflict("tracked/home/.zshrc")],
..Default::default()
};
notify_conflicts_with(&mut status, false, |_, _| panic!("notifications disabled"));
assert!(status.conflict_pause_observed);
}
}
#[cfg(test)]
mod status_tests {
use super::*;
fn conflict() -> Conflict {
Conflict {
branch_path: "tracked/home/.zshrc".to_string(),
kind: reconcile::ConflictKind::SameHunk,
local: None,
remote: None,
base: None,
}
}
View on GitHub (pinned to afd2eddd3a)
Solutions
- Check `notify_conflicts_with` gates every callback invocation behind the enabled flag (`true`/`false` argument).
- Ensure `conflict_pause_observed` is set without calling the callback when notifications are off.
- Add coverage for each conflict path to confirm none bypass the disable check.
- If the callback must run for bookkeeping, split observation from notification instead of calling the notifier.
Example fix
// before
notify_conflicts_with(&mut status, false, |_, _| panic!("notifications disabled"));
// after
// in notify_conflicts_with:
if enabled {
callback(path, &conflict);
}
status.conflict_pause_observed = true; Defensive patterns
Strategy: try-catch
Validate before calling
// rust: assert the gate before calling assert!(!notifications_enabled(), "test expects notifications disabled");
Try / catch
// rust: spy callback must stay uninvoked; catch regressions in CI
notify_conflicts_with(&mut status, false, |path, c| {
panic!("notifications disabled but callback invoked for {path:?}: {c:?}")
}); Prevention
- Gate every notification call site behind the enabled flag.
- Use spy/panic callbacks in tests to catch accidental notifications.
- Cover all conflict kinds with opt-out tests.
- Separate observation state updates from side-effecting callbacks.
When it happens
Trigger: `notify_conflicts_with(&mut status, false, callback)` invoking the callback despite notifications being disabled — i.e. the function fails to check the enabled flag before notifying.
Common situations: A regression in `notify_conflicts_with` that ignores the boolean enable flag; new conflict kinds routed around the gate; refactors that call the callback for pause-observed bookkeeping.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09).
Data as JSON: /api/errors/29f768f35c23757e.
Report an issue: GitHub.