Handle removed issue in repairs ignore_issue websocket command (#183934)

This commit is contained in:
John Costa
2026-10-06 06:00:08 +00:00
committed by Franck Nijhof
parent 4f52a53a17
commit b98e990a95
2 changed files with 13 additions and 1 deletions
@@ -72,7 +72,15 @@ def ws_ignore_issue(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
) -> None:
"""Fix an issue."""
ir.async_ignore_issue(hass, msg["domain"], msg["issue_id"], msg["ignore"])
issue_registry = ir.async_get(hass)
if not issue_registry.async_get_issue(msg["domain"], msg["issue_id"]):
connection.send_error(
msg["id"],
"unknown_issue",
f"Issue '{msg['issue_id']}' not found",
)
return
issue_registry.async_ignore(msg["domain"], msg["issue_id"], msg["ignore"])
connection.send_result(msg["id"])
@@ -195,6 +195,10 @@ async def test_dismiss_issue(
)
msg = await client.receive_json()
assert not msg["success"]
assert msg["error"] == {
"code": "unknown_issue",
"message": "Issue 'no_such_issue' not found",
}
await client.send_json(
{