Skip to content

[web] advisory banner 是死代码:/__bili/overview 不含 advisory 字段,web 客户端从不调用 /__bili/status #2152

Closed

Description

@ranxianglei

[bot] 🏷 已修复:PR #2153(advisory-overview-banner,已合入 master)正是按本 issue 建议的最小改动实现的——新增共享构造 currentAdvisoryPayload(),advisory 字段同时出现在 /__bili/status 与 /__bili/overview,web banner 数据通路接通。关闭本 issue。顺带记录:#2148 的 PR(#2151)rebase 时与 #2153 在 sendStatus 同一行有文本冲突(两边都在加 advisory 相关字段),已按「用共享 helper + 保留 dshChannel 字段」解决。

Activity

  1. ranxianglei commented on Oct 5, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework · qwen3.8-27b

    已修复并提 PR:ranxianglei/billion-context#2153(base master,分支 2026-10-05_advisory-overview-banner,rebased 到当前 master bb41405c)。

    是什么问题:Web UI 的 critical-advisory 横幅是死代码——渲染逻辑 renderBanners(src/web/client.ts)一直在读 /__bili/overview 返回体里的 advisory 字段,但那个端点从不返回这个字段,所以横幅永远 hidden。#1481/#1588 建立的 critical 公告机制对只看 web UI 的用户完全不可见(此前只有 /acp panel 和日志能看到)。

    什么原因导致的:信号通路建了大半、最后一跳没接上,且根因是「两个应当一致的 surface 各写各的」。advisory 状态(getAdvisoryState())只有 /__bili/status 把它序列化进 payload;而 web 客户端唯一的数据源是 loadOverview() → GET /__bili/overview(client.ts 全文件没有一处调 /__bili/status)。两个端点各自独立构造 payload,sendOverview 漏掉 advisory → d.advisory 恒为 undefined → 横幅恒不显示。这是数据层断线,不是渲染层的问题——renderBanners 一直是好的,只是从没拿到过数据。

    怎么修复的:把 advisory 字段的构造抽成一个共享函数 currentAdvisoryPayload()(getAdvisoryState() + targetFailed 计算),让 /__bili/status 和 /__bili/overview 都调用它——从结构上保证两个 surface 再也无法漂移(这正是本次 bug 的机制);再把该字段加进 sendOverview 的 payload。现有 banner 读取逻辑零改动。

    是否有回归问题:审过的既有行为:① /__bili/status 输出改用共享函数后字节级不变(纯重构);② /__bili/overview 新增 advisory 字段(additive:旧 = 无此 key → 新 = null 或 active entry + targetFailed),唯一消费者就是来读它的 web client,不受影响;③ 全仓没有任何测试对 overview 整体做 exact-equality(upstream-alerts.test.ts 只取 .alerts),wire-contract golden 也不 pin 这两个端点 body。高危模式逐项过:无语义漂移、无 fail-fast 变吞错、无阈值/时序/默认值变化。行为变更披露(交付规则第 4 条):GET /__bili/overview 响应新增 advisory 字段,纯 additive,已在 PR 描述标注 old→new。本地验证:typecheck clean、39 条相关定向测试(parity / advisory / advisory-panel / acp-status / upstream-alerts)全绿、build 成功;新回归测试已验证「去掉 fix 即红」。

    是否破坏缓存:不涉及。这是管理端点(/__bili/*)的响应 shape,与模型流量、prefix cache、重试、增量游标、去重键均无关;plugin / proxy 两种压缩模式都不受影响。

    是否改了设计方向:不涉及架构转向。仅把「两端点各自构造 advisory」收敛为「单一共享构造」,属既有边界内的去重,数据流不变(advisory 来源仍是 advisory watcher)。

    是否引入了新的配置:不涉及。无新 env / config / 默认值。

    判定:干净的单模块 bugfix,满足 §7.4 自动合并门禁(单模块、有可复现回归测试且已验证红→绿、rebased 到当前 master、不动 config schema / 持久化 / wire / kernel / load-bearing infra、纯 fix、diff 干净、引用本 issue)。CI 全局把关中,可合并。

  2. added a commit that references this issue on Oct 5, 2026
  3. added a commit that references this issue on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions