add dismiss/undo for system health dashboard warnings - #6399
Merged
Conversation
Warnings on the Live health page and dashboard widget are recomputed fresh every read, so a stale-but-still-true condition (e.g. a crash-loop restart count that hasn't reset) stuck around with no way to clear it. Dismissing a warning now records its (type, message) pair server-side; the next read hides it as long as that exact occurrence recurs, and auto-un-dismisses (with the stale record pruned) once the condition changes or clears, so a genuinely new occurrence is never silently hidden. An Undo toast reverses a dismissal immediately.
The Undo toast's request had no .catch, so a failed undo silently no-oped while the toast still disappeared, leaving the user unaware the warning wasn't actually restored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/system-resources/overviewpage). Dismissing records the warning's(type, message)pair server-side; the next read hides it as long as that exact occurrence recurs, and auto-un-dismisses (pruning the stale record) once the condition changes or clears — so a genuinely new occurrence is never silently hidden.POST/DELETE /api/system/health/warnings/:type/dismiss.useHealthWarningDismisshook (used by both surfaces), and consolidated the server-side settings.health merge idiom into onepatchHealthhelper.Test plan
server/routes/health.test.js: new coverage for suppress-on-match, show-again-on-different-message, stale-dismissal pruning, and the dismiss/undo endpoints (invalid type, missing message).client/src/components/SystemHealthWidget.test.jsxandclient/src/pages/SystemHealthPage.test.jsx: dismiss + refetch, and error-toast-on-failure.npm testinserver/) and client (npm testinclient/) suites pass.