Skip to content

test(objectql): 补上运行时汇总字段修复的三个邻近路径 (#4427 后续) - #4428

Closed
os-zhuang wants to merge 1 commit into
mainfrom
fix/summary-index-invalidate-on-register
Closed

test(objectql): 补上运行时汇总字段修复的三个邻近路径 (#4427 后续)#4428
os-zhuang wants to merge 1 commit into
mainfrom
fix/summary-index-invalidate-on-register

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

原本这个 PR 带着一份和 #4427 等价的实现(同样在 registry 上加单调 revision、同样那 5 处 bump、引擎同样记 revision 重建)——两边是并行做的。#4427 先落地,所以这里把实现全部去掉,只留 #4427 没有覆盖到的测试。现在是纯测试改动。

补什么

#4427 钉住了主路径:索引建好之后才注册的对象能算对。同一个 revision 计数器还负责另外三条邻近路径,那个 PR 都没有测到,而在修复前它们各自独立地坏着

  1. 给已经注册过的对象追加汇总字段 —— update_metadata 增量编辑那条路。对象已经上线了,所以这走的是「替换已有 contributor」,不是「新增对象」。
  2. 父对象注销之后要停止重算 —— 这个 bug 的反面:陈旧索引会继续往一个已经不存在的父对象上写。
  3. 子记录自己那次 insert 就得是对的,而不是靠后续某次写入悄悄补上 —— 这正是原缺陷最难抓的地方:那个 no-op PATCH 绕过办法每次都给出正确答案,于是很容易误判成「偶发」而不是「时序」。

这些用例不是白写的

#4427getSummaryDescriptors 的改动回退掉,三个全部失败(roll-up 读到 undefined),和它自己那个用例一起挂。恢复后 12/12 通过。

  • objectql:1504 通过
  • tsc --noEmit 干净
  • 仅改 summary-rollup.test.ts,无实现改动

附:#4427 的修复在真机上确认有效

run-stack.sh --prod-like --seed 跑同一句「项目任务管理」提示词,带负控制:

任务总数 已完成任务数(带 filter) 预估总工时
带修复 12/12 与子表吻合 完全吻合 完全吻合
回退修复 全 NULL 全 NULL 全 NULL

两次子表数据都正常。(这份 E2E 是在 #4427 合并前、对等价实现跑的;机制相同。)

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 1, 2026 5:10am

Request Review

…ll-up fix

#4427 made the summary index follow `registry.objectRevision` and pinned the
headline path: an object registered after the index was already built. The
same counter is responsible for three neighbouring behaviours it does not
exercise, and each was independently broken before that fix:

- re-registering an EXISTING object with a new summary field (the
  `update_metadata` incremental-authoring path — the object is already live,
  so this replaces a contributor rather than adding an object)
- unregistering the parent, after which its roll-up must STOP being recomputed
  (the mirror of the bug: a stale index keeps writing to a parent that is gone)
- the child's own insert already being correct, rather than a later write
  quietly repairing it — the property that made the original defect so
  slippery, since the no-op PATCH workaround always produced right answers

Verified they earn their place: reverting #4427's `getSummaryDescriptors`
change fails all three (roll-up `undefined`), alongside its own case.

objectql 1504 tests pass; tsc clean. Test-only change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@xuyushun441-sys
xuyushun441-sys force-pushed the fix/summary-index-invalidate-on-register branch from 27c37fb to 884bfc4 Compare August 1, 2026 05:10
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

No hand-written docs reference the 0 changed package(s). ✅

@os-zhuang os-zhuang changed the title fix(objectql): roll-up 索引要跟着 registry 走,而不是只跟着 registerApp test(objectql): 补上运行时汇总字段修复的三个邻近路径 (#4427 后续) Aug 1, 2026
@os-zhuang os-zhuang closed this Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant