fix(UME): 兼容首批无marker场景并补充回归测试

告警分页在响应头缺失 marker 时直接结束迭代,避免首批已全量却重复翻页;同时补充对应单测并保持 HTTPTransport 传输方式与现网一致。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-05-08 20:13:10 +08:00
parent 2c0b52d972
commit 00afaaae3d
3 changed files with 35 additions and 4 deletions

View file

@ -282,8 +282,12 @@ def _sync_alarms_common(
next_marker = str(diag.marker or "").strip()
if is_end_of_reply:
break
# marker paging: no marker and empty data means no next page.
if not next_marker and not rows:
# marker paging: if response header has no marker, treat as end of iteration.
# Some UME deployments omit marker when the first page already contains all rows.
if not next_marker:
if rows:
warnings.append("marker_missing_stop")
paging_note = "marker_missing_stop"
break
if not is_uncleared: