线上紧急修复 round7-9:审核工作台加载、随机领取入口、视频进度条 #39

Merged
zhanghongming merged 3 commits from codex/slow-page-performance-20261009 into dev 2026-10-12 14:53:13 +08:00
Collaborator

背景

PR #38 合入后线上又暴露三个问题,按紧急修复流程分三轮上线验证完毕(release 记录 slow-page-fix-round7/8/9-20261012,均已 deployed_pending_acceptance)。本 PR 把这三轮改动合入 dev,共 3 个提交、11 文件 +315/−47。

round7 9d1c2252 — 审核工作台加载(12-14s → 毫秒级)

线上实测根因:

  1. available 池查询未下推 stageId:Mongo 对 17,220 条未领取积压做内存排序,每轮 ~7s、客户端最多重试 6 轮(线上日志 12-14s)。
  2. round4 任务分页引入回归(如实说明:上一轮我引入的):池子条目引用的 legacyTaskId 不在最新 200 任务窗口内,join 缺失 → 前端报「任务关联数据缺失」。修复:审核工作区改为按池条目的 ids 精确取任务(池决定可见性),窗口机制仅保留给标注/管理员视图。
  3. claim-count 逐条点查 12,009 个遗留批次(3.4s/次)→ 改为单次 $in 批量读取;顺带修复其投影缺 status 字段导致已完成批次误计入可领取数的老 bug。

上线后实测:池 86ms(29 条候选)、任务 join 17ms 29/29 全覆盖、>1s 慢请求清零。

round8 bc58adb1 — 视频进度条 + 随机领取入口

  1. 三角色进度条冻结:vendored movi-player 0.4.1 不向宿主元素转发 timeupdate/seeking/seeked/waiting(插桩实测:shadow video ~4 事件/秒,宿主 0)。MoviVideo 增加 shadow→host 事件桥接,播放中进度条 ~4Hz 连续推进。纯前端 +66 行,无新增请求。
  2. 随机领取入口:审核员的随机领取只存在于从未合入的 oct8 分支(移植过来);验收员的入口为 round7 重构时误删(如实说明),本轮恢复。

round9 fc52ae9e — 按钮可用性 + 更名

  1. 审核按钮残留 !projectId 旧门槛,默认「全部项目」视图下永远灰着 → 移除项目门槛,领取后自动带上条目的 projectId。
  2. 验收按钮只在「可领取」tab 渲染 → 改为工作台常显,候选固定取自可领取池。
  3. 两个按钮统一更名「随机领取」。

验证

  • Go:api 失败 65 = 既有基线,逐项核对零新增(本轮 Go 改动与 round7 相同已在生产运行)
  • 前端:631/645 vs 基线 630/645,失败均为既有文案债;随机领取 E2E 本地真实浏览器双角色领取 200 并进入会话
  • 17k 任务压测副本:ids join 500/500、78ms;50 并发场景无新增 API/轮询
  • 生产上线后:Pod 全 ready 0 重启、0 慢请求 0 5xx 0 panic

遗留说明

  • 发现一个 round6 起存在的时序问题(偶发首次点播放无响应,任意 seek 后恢复),不在本轮 scope,已记录在 release 证据中待单独修。
  • 前端更新需用户刷新页面生效。
## 背景 PR #38 合入后线上又暴露三个问题,按紧急修复流程分三轮上线验证完毕(release 记录 `slow-page-fix-round7/8/9-20261012`,均已 `deployed_pending_acceptance`)。本 PR 把这三轮改动合入 dev,共 3 个提交、11 文件 +315/−47。 ## round7 `9d1c2252` — 审核工作台加载(12-14s → 毫秒级) 线上实测根因: 1. **available 池查询未下推 stageId**:Mongo 对 17,220 条未领取积压做内存排序,每轮 ~7s、客户端最多重试 6 轮(线上日志 12-14s)。 2. **round4 任务分页引入回归(如实说明:上一轮我引入的)**:池子条目引用的 legacyTaskId 不在最新 200 任务窗口内,join 缺失 → 前端报「任务关联数据缺失」。修复:审核工作区改为按池条目的 ids 精确取任务(池决定可见性),窗口机制仅保留给标注/管理员视图。 3. **claim-count 逐条点查 12,009 个遗留批次**(3.4s/次)→ 改为单次 `$in` 批量读取;顺带修复其投影缺 `status` 字段导致已完成批次误计入可领取数的老 bug。 上线后实测:池 86ms(29 条候选)、任务 join 17ms 29/29 全覆盖、>1s 慢请求清零。 ## round8 `bc58adb1` — 视频进度条 + 随机领取入口 1. **三角色进度条冻结**:vendored movi-player 0.4.1 不向宿主元素转发 `timeupdate/seeking/seeked/waiting`(插桩实测:shadow video ~4 事件/秒,宿主 0)。MoviVideo 增加 shadow→host 事件桥接,播放中进度条 ~4Hz 连续推进。纯前端 +66 行,无新增请求。 2. **随机领取入口**:审核员的随机领取只存在于从未合入的 oct8 分支(移植过来);验收员的入口为 round7 重构时误删(如实说明),本轮恢复。 ## round9 `fc52ae9e` — 按钮可用性 + 更名 1. 审核按钮残留 `!projectId` 旧门槛,默认「全部项目」视图下永远灰着 → 移除项目门槛,领取后自动带上条目的 projectId。 2. 验收按钮只在「可领取」tab 渲染 → 改为工作台常显,候选固定取自可领取池。 3. 两个按钮统一更名「随机领取」。 ## 验证 - Go:api 失败 65 = 既有基线,逐项核对零新增(本轮 Go 改动与 round7 相同已在生产运行) - 前端:631/645 vs 基线 630/645,失败均为既有文案债;随机领取 E2E 本地真实浏览器双角色领取 200 并进入会话 - 17k 任务压测副本:ids join 500/500、78ms;50 并发场景无新增 API/轮询 - 生产上线后:Pod 全 ready 0 重启、0 慢请求 0 5xx 0 panic ## 遗留说明 - 发现一个 round6 起存在的时序问题(偶发首次点播放无响应,任意 seek 后恢复),不在本轮 scope,已记录在 release 证据中待单独修。 - 前端更新需用户刷新页面生效。
zhanghongming added 3 commits 2026-10-12 13:57:36 +08:00
User report on production: reviewers saw 正在加载任务… for a long time and
then 任务关联数据缺失,请联系管理员核查; annotator loading slow; acceptance
fast. Production traces showed three distinct causes:

1. /api/human-items available pool 12-14s: the role pools filtered stages
   only in-memory, so Mongo sorted the whole 17,220-doc unassigned backlog
   (~7s per fetch round, up to 6 rounds) before the handler dropped nearly
   every row. Acceptance was fast because its query already pushed stageId.
   Fix: HumanItemQuery.StageIDs  pushdown (parseHumanItemQuery accepts
   stageIds=a,b,c merged with stageId); the quality/clip-quality/acceptance
   workspaces send their stage set; review pool joins no longer depend on
   the backlog sort.

2. 任务关联数据缺失 regression (introduced by the round4 task-list
   pagination): review pool pages reference tasks across the whole backlog,
   but the tasks fetch took a newest-first 200 window — only 60/500 pool
   items could find their task. Fix: review workspaces (reviewOnly) fetch
   tasks by the pool page's legacyTaskIds via the new ids= parameter
   (id_unique ); ListAnnotationTasksFiltered gains an IDs mode in both
   stores; the misleading 任务关联数据缺失 empty-state is scoped to
   non-review workspaces (review pool loading shows its own message).

3. claim-count 3.4s: one per-candidate GetHumanBatch point lookup over
   12,009 legacy batches. Fix: single ListHumanBatchAccessRecords  read;
   its projection now also carries status (the completed check read a
   missing field before).

Verified on the 17k-item stress replica: pool 421→308ms with stage pushdown;
ids join returns 500/500 pool items in 78ms (was 0/440 outside the window);
claim-count 128ms. Full suites: 65 failures = the 65 pre-existing upstream
debt, no new.
Production report: for all three roles the video progress bar stayed frozen
during playback and only jumped to the playhead position on pause, and the
reviewer/acceptance random-claim buttons were gone.

Root cause (progress bar): the vendored movi-player 0.4.1 dist re-dispatches
play/pause/ended/playing/canplay/loadedmetadata/durationchange/progress on
the host element but NOT timeupdate/seeking/seeked/waiting from its shadow
<video>. Verified with an instrumented page: the shadow video fires ~4
timeupdate/s during playback while the host receives zero. The workbench
playhead, time display and fragment-end enforcement are driven by
onTimeUpdate, so they only moved when the transport re-read currentTime on
pause. MoviVideo now bridges those four events from the shadow video onto
the registered handlers with the host as currentTarget, so master-element
checks and proxied media property reads keep working for both camera
bridging and MaterializedSliceWorkbench sync.

Buttons: round7 (9d1c2252) dropped the acceptance random-claim entry as
collateral of the pool-join rework — restore it verbatim
(claimPrepackageAcceptance returns the claimed item again). The reviewer
random-claim entry (随机领取并开始审核) only ever lived on
codex/oct8-feedback-fixes and never merged; port it gated to quality review
workspaces.

Verified against the local snapshot replica: reviewer and acceptance
buttons render, claim and navigate (browser E2E); the production build
plays video with the playhead advancing at ~4Hz through 8s of samples;
frontend suite 631/645 pass vs 630/645 at the parent commit (failures are
pre-existing UI-copy debt, unchanged).
zhanghongming merged commit 1469661338 into dev 2026-10-12 14:53:13 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: longtao.wu/droboticflow#39
No description provided.