mirror of
https://github.com/home-assistant/core.git
synced 2026-12-03 12:21:04 -04:00
Handle removed issue in repairs ignore_issue websocket command (#183934)
This commit is contained in:
@@ -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(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user