Skip to content

fix(threats): treat v2 IPS success as authoritative#628

Open
jedis00 wants to merge 1 commit into
Ozark-Connect:mainfrom
jedis00:fix/threat-v1-fallback-spam
Open

fix(threats): treat v2 IPS success as authoritative#628
jedis00 wants to merge 1 commit into
Ozark-Connect:mainfrom
jedis00:fix/threat-v1-fallback-spam

Conversation

@jedis00
Copy link
Copy Markdown

@jedis00 jedis00 commented May 20, 2026

When ThreatCollectionService polls for IPS events, it calls the v2 system-log endpoint first, then falls back to the v1 stat/ips/event endpoint. The early-return guard in the v2 branch only triggers when the response contains one or more events, so a successful v2 response with zero new events falls through to v1. On UniFi Network 10.2.x the v1 endpoint has been removed and returns 404, which the generic API wrapper logs at ERR level before the outer try/catch can swallow it. Result: one 'API call failed with status NotFound' entry per poll cycle indefinitely on any healthy controller with no new threats in the window.

Treat a v2 response with a defined ValueKind as authoritative. The v1 fallback now only runs when v2 itself throws or returns Undefined, which is the original intent.

When ThreatCollectionService polls for IPS events, it calls the v2
system-log endpoint first, then falls back to the v1 stat/ips/event
endpoint. The early-return guard in the v2 branch only triggers when
the response contains one or more events, so a successful v2 response
with zero new events falls through to v1. On UniFi Network 10.2.x the
v1 endpoint has been removed and returns 404, which the generic API
wrapper logs at ERR level before the outer try/catch can swallow it.
Result: one 'API call failed with status NotFound' entry per poll
cycle indefinitely on any healthy controller with no new threats in
the window.

Treat a v2 response with a defined ValueKind as authoritative. The
v1 fallback now only runs when v2 itself throws or returns Undefined,
which is the original intent.
@tvancott42 tvancott42 self-assigned this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants