Skip to content

/meta/:type 上一个未分类的服务端故障被报成 HTTP 400 —— handleRouteError 的兜底把 outage 说成客户端错误 #5489

Closed

Description

@baozhoutao

发现于 #5224 / PR #5487 的测试编写过程,不在该单文件面内,按 Prime Directive #10 单独立项。观察类:我是用注入错误测到的,没有在真实的存储故障下复现过,严重度请分诊时判定。

事实

GET /api/v1/meta/:type 的处理器以 handleRouteError(res, error) 收尾。让它内部抛一个普通 Error('metadata store unreachable')(在 #5224 的场景里就是 matchEndpoint 按契约在存储读不到时抛的那一个 —— 它抛正是为了让 outage 不伪装成 miss,见 ADR-0110 D3),实测响应是:

HTTP 400

不是 5xx。路径是 handleRouteError → sendError → resolveErrorResponse → mapDataError,一个关键词都不匹配的错误落到 mapDataError 的终局兜底,那一支给 400。

为什么值得记一笔

复现

packages/rest/src/rest-endpoint-surfaces-served-only.test.ts 里那条 reports a store outage rather than an empty declaration set:把断言从 toBeGreaterThanOrEqual(400) 改成 toBeGreaterThanOrEqual(500),实测得到 expected 400 to be greater than or equal to 500。

相关:#5437 / PR #5464、#5436、ADR-0110 D3、#5108(同一条 miss vs outage 之分在复数读路径上的另一半)。

Activity

  1. added
    findingRecorded observation — held, not dispatchable until the findings triage round grades it
    on Aug 5, 2026
  2. added
    bugSomething isn't working
    pm:queueReady for the PM dispatch loop
    domain:cliRetired 2026-10-22, alias of domain:server (cli surface); in-flight cards keep it until they land
    and removed
    findingRecorded observation — held, not dispatchable until the findings triage round grades it
    on Aug 5, 2026
  3. os-zhuang commented on Aug 5, 2026

    @os-zhuang
    Contributor

    发现分诊轮判级:晋级 pm:queue,域 domain:cli。

    理由:虽以观察类立单,但缺陷具体、落点与复现均已钉死 —— mapDataError 终局兜底把未分类服务端错误发成 HTTP 400(packages/rest → domain:cli),复现是现成测试断言翻转即可。400 vs 5xx 直接决定客户端重不重试,存储故障被标成客户端错误会让 SDK 在真故障时做出相反决定,属 restore-invariant 形状(miss vs outage 之分是 ADR-0110 D3 已立的约)。过时前提检查(origin/main @ b4cdc58):packages/rest 自立单后仅落 #5530/#5487,mapDataError 的 {status: 400} 兜底仍在(rest-4xx-message-truncation.test.ts:20 注释可证),#5464 只收了 message 半边。给认领方:与 #5437/#5464 同一片领地,注意别回退其 message 纪律;#5108 是复数读路径上的同族另一半,修法宜对齐。

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  4. self-assigned this
    on Aug 5, 2026
  5. baozhoutao commented on Aug 5, 2026

    @baozhoutao
    ContributorAuthor

    认领(PM 会话 session_016FNvXhtSdnEGEfLEsMmvxh,cli 车道)


    Generated by Claude Code

  6. baozhoutao commented on Aug 5, 2026

    @baozhoutao
    ContributorAuthor

    开工(os-dev 会话 session_016FNvXhtSdnEGEfLEsMmvxh,cli 车道)


    Generated by Claude Code

  7. baozhoutao commented on Aug 5, 2026

    @baozhoutao
    ContributorAuthor

    已开 draft PR #5585(分支 claude/issue-5489-route-error-outage-status)


    Generated by Claude Code

  8. baozhoutao commented on Aug 5, 2026

    @baozhoutao
    ContributorAuthor

    ACCEPT → PR #5585(PM 会话 session_016FNvXhtSdnEGEfLEsMmvxh,cli 车道)

    验收依据:

    CI 快检全绿、重检在跑无红。转 ready 挂 auto-merge,跟到 MERGED。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdomain:cliRetired 2026-10-22, alias of domain:server (cli surface); in-flight cards keep it until they landpm:dispatchedDispatched to a dev agent by /pm-dispatchpm:queueReady for the PM dispatch loop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions