Skip to content

objectui: 登录页在无会话时仍拉 /meta/*,登录前刷 30 条 401 报错,且日志打成 [object Object] 无法定位 #5751

Closed as not planned

Description

@os-zhuang

浏览器 dogfood 时发现(最新 main 5e3c83bd0 + objectui 5a24ad9cb89c)。前端侧问题,故打 repo:objectui。

现象

打开 /_console/(未登录,停在登录页),还没输入任何东西,浏览器控制台就已经刷了 30 条:

[error] HTTP request failed  [object Object]
[error] HTTP request failed  Object
… ×30

网络面板看,登录页在没有会话的情况下反复发认证接口,每轮 5 条 401:

GET /api/v1/auth/get-session   → 200 OK      ← 已经知道没有会话了
GET /api/v1/meta/object        → 401 Unauthorized
GET /api/v1/meta/view          → 401 Unauthorized
GET /api/v1/meta/app           → 401 Unauthorized
GET /api/v1/meta/object        → 401 Unauthorized   ← 同一轮里重复
GET /api/v1/meta/view          → 401 Unauthorized   ← 同一轮里重复

这一轮共重复 3 次(3 次渲染周期)= 15 条 401,每条打 2 行日志 = 30 条控制台报错。

登录之后同样这几个接口全部 200。为确认登录后是干净的,我在页面里挂了个 fetch 探针,然后走了 8 条路由(command center / ops dashboard / revenue pulse / task 列表 / 4 张报表):

{ "visited": ["ok showcase_command_center","ok showcase_ops_dashboard","ok showcase_revenue_pulse",
              "ok tabular","ok showcase_hours_by_status","ok showcase_hours_by_status_chart",
              "ok showcase_status_priority_matrix","ok showcase_task_overview"],
  "failures": [] }

零失败。 所以这 30 条报错完全来自登录前那一段。

两个独立的小问题

1)无会话时就发起需要会话的请求。 get-session 已经返回了「没有会话」,紧接着仍然去拉 /meta/object、/meta/view、/meta/app。这些请求注定 401,是纯浪费;而且同一轮里 meta/object、meta/view 各发了两次,说明还多了一次重复触发。

2)报错日志把错误对象打成了 [object Object]。 这是更影响排查的一条:30 条报错里没有任何一条能告诉你是哪个 URL、什么状态码。真要定位只能自己去翻网络面板。日志这里应该展开成 method + url + status(至少别做字符串拼接把对象吞掉)。

影响面

  • 功能无影响:登录后一切正常,上面 8 条路由零失败。
  • 影响的是开发与排查体验:任何人打开控制台第一眼就看到 30 条红色 HTTP request failed,而它们既不指向真问题、也不含可用信息。本次排查中我一度以为应用真的坏了,是逐条比对网络面板才确认全是登录前的噪音。
  • 服务端日志同样会多出这批 401。

建议方向(实现者自选)

  1. 登录路由下,等 get-session 确认有会话再拉 /meta/*(或者让这些 query 依赖会话状态作为 enabled 条件);顺带查一下同一轮里 meta/object / meta/view 为何各发两次。
  2. HTTP 客户端的错误日志展开成结构化字段(method/url/status/code),不要落成 [object Object]。这条即便 1 不做也值得单独做 —— 它决定了下一次真出问题时,控制台是能用的还是没用的。

复现

  1. 起一个 dev 实例,浏览器打开 http://localhost:<port>/_console/,不要登录
  2. 开控制台 → 30 条 HTTP request failed [object Object]
  3. 网络面板筛 api/v1 → 15 条 401,全部在登录 POST 之前

Activity

  1. added
    bugSomething isn't working
    repo:objectuiSeam card: cross-repo ordering with objectui is the substance (pure objectui fixes live in objectui)
    findingRecorded observation — held, not dispatchable until the findings triage round grades it
    on Aug 6, 2026
  2. added
    pm:queueReady for the PM dispatch loop
    and removed
    findingRecorded observation — held, not dispatchable until the findings triage round grades it
    on Aug 6, 2026
  3. claude commented on Aug 6, 2026

    @claude
    Contributor

    分诊(发现分诊轮,#4949 纪律):晋级 pm:queue,摘 finding。

    • 路由:repo:objectui(维持;落 objectui 前端,按协议不打 domain:*)。
    • 落点锚定:两处都在 objectui,本仓无落点 ——(1)登录路由下 /meta/object、/meta/view、/meta/app 的查询没有以会话状态作 enabled 条件(get-session 已返回「无会话」仍继续发,且同一轮 meta/object / meta/view 各重复一次,提示多一次触发);(2)HTTP 客户端的错误日志把 error 对象拼进字符串 ⇒ [object Object],30 条报错里没有一条能给出 method / url / status。具体文件由 objectui 座位在本仓定位。
    • 为什么晋级(不按观察类持有):有确定的复现步骤(未登录打开 /_console/,控制台 30 条、网络面板 15 条 401 全在登录 POST 之前)与两条互相独立、各自可交付的修法;第 2 条即便第 1 条不做也值得单独做 —— 它决定下一次真出问题时控制台是否可用。功能面无影响,但这是可派发缺陷,不是「没什么人会撞上的观察」。
    • 过时前提检查:正文读数取自最新 main 5e3c83bd0 + objectui 5a24ad9cb89c(立单于本轮前 ~50 分钟),前提未过时。
    • 查重:objectui 仓 open issue / PR 无 login / 401 / meta 影子单;objectstack 侧同。

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


    Generated by Claude Code

  4. os-zhuang commented on Aug 10, 2026

    @os-zhuang
    ContributorAuthor

    Migrated to objectstack-ai/objectui#4042 under #7167 (file-at-destination ruling, maintainer 2026-08-10). Native GitHub issue transfer is not available to this session's credential, so the card was recreated at the destination; this thread stays as the authoritative history and is linked from the new card. Closing as not planned here — moved, not rejected.


    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

No one assigned

    Labels

    bugSomething isn't workingpm:queueReady for the PM dispatch looprepo:objectuiSeam card: cross-repo ordering with objectui is the substance (pure objectui fixes live in objectui)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions