From db8c77a2e5e65f2cd70009091ef115f5f4125506 Mon Sep 17 00:00:00 2001 From: oliver Date: Thu, 6 Aug 2026 16:19:14 +0800 Subject: [PATCH] Treat UME stream handshake 500 as a lost subscription. Stop infinite reconnect loops when ZTE returns HTML 500 for a dead stream id and surface re-establish in the UI. Co-authored-by: Cursor --- netx_api/ume_alarm_ws_log.py | 3 +++ tests/test_ume_sync.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/netx_api/ume_alarm_ws_log.py b/netx_api/ume_alarm_ws_log.py index 2506573..1538a9f 100644 --- a/netx_api/ume_alarm_ws_log.py +++ b/netx_api/ume_alarm_ws_log.py @@ -24,8 +24,11 @@ _SUBSCRIPTION_MISSING_MARKERS: tuple[str, ...] = ( "status-reason: subscription not found", "non-101 status: 503", "non-101 status: 404", + "non-101 status: 500", "handshake status 404", "handshake status 503", + # ZTE UME often returns HTML 500 when the stream id is gone/invalid. + "handshake status 500", ) diff --git a/tests/test_ume_sync.py b/tests/test_ume_sync.py index c048405..b5283e6 100644 --- a/tests/test_ume_sync.py +++ b/tests/test_ume_sync.py @@ -753,6 +753,11 @@ class UmeAlarmNotificationTests(unittest.TestCase): 'ume_request_failed:DELETE ... 400:{"errorInfo":"subscription not exist!"}' ) ) + self.assertTrue( + is_ume_subscription_missing_error( + "Handshake status 500 Server Error -+-+- {'content-type': 'text/html'}" + ) + ) def test_cancel_returns_needs_cleanup_when_ume_missing(self): from time import time as _time