History log "committed" column is inaccurate
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 src/cls/IPM/General/AbstractHistory.cls:124 的 %IPM.General.AbstractHistory:Finalize() 开始,跟踪 %IPM.Utils.Module:LoadModuleFromDirectory() 中大约第 1137-1315 行的事务设置、开发者模式解析、提交和回滚路径。分别复现使用 -dev 加载格式错误的 module.xml,以及使用 -DNoTransaction=1 进行安装;完成标准是 Committed 与更改是否实际保留相一致。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The Committed column on history records does not reliably indicate whether an action's changes survived. It is computed from the action's status and whether developer mode was on, rather than from what actually happened to the transaction:
%IPM.General.AbstractHistory:Finalize() (src/cls/IPM/General/AbstractHistory.cls:124):
set ..Committed = (dev = 1) || $$$ISOK(status)
This is wrong in both directions.
Dev-mode failures are always marked committed, even when fully rolled back.
In %IPM.Utils.Module:LoadModuleFromDirectory(), the transaction opens at line 1160 and the first developer-mode tcommit is at line 1272. tDeveloperMode is not even resolved until line 1259. Everything in that window runs inside a transaction that the catch block rolls back at lines 1313-1315, regardless of developer mode.
So a -dev action that fails before line 1272 (for example a malformed module.xml rejected in GetModuleObjectFromPath) is rolled back in full, but its history record still reads Committed.
The intended dev-mode behavior for phases after line 1272 is correct and is not at issue here. The early-failure window is.
Non-transactional failures are marked uncommitted despite keeping their changes.
tUseTransactions is false when -DNoTransaction=1 or -DNoJournal=1 is passed (line 1137). No transaction is opened, so a failure leaves partial changes in the namespace. Because the status is an error and developer mode is off, the record reads Uncommitted.
To Reproduce
Rolled-back action reported as committed:
load /path/to/malformed-module -devwhere the directory contains amodule.xmlwith a syntax errorhistory find -limit 5- The record shows an error in
SuccessandCommittedinCommitted, even though the transaction was rolled back and nothing was written
Retained changes reported as uncommitted:
install some-module -DNoTransaction=1with a module whoseActivatephase failshistory find -limit 5- The record reads
Uncommitted, but partial changes remain in the namespace
Expected behavior
Committed should reflect whether the action's changes were actually retained.
Options, roughly in increasing order of effort:
- Compare
$tlevelagainst the level captured at entry, or have the rollback path signal that it ran, and pass that toFinalize()instead of inferring fromdev. - Set
Committedat each commit point rather than once at the end, so the flag tracks how far the action actually got. - If the current value is intentional as a coarse signal, rename it or document it as "changes may have been retained" and stop treating
dev = 1as sufficient.
Option 1 is the smallest change that fixes both directions, since it makes the flag observed rather than derived.
System information
- IPM version: 0.10.5+
- 主要语言
- ObjectScript
- 星标
- 41
- 派生
- 30
- 平均合并
- 4 天 10 小时
- 30 天内合并 PR
- 10
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
intersystems/ipm 的其他 Issue
-
bug
难度 1/5 1 小时以内 新手友好度 78/100
intersystems/ipm#1258 ·
维护者通常 1 天内回复
-
bug technical debt
难度 2/5 1-3 小时 新手友好度 70/100
intersystems/ipm#1251 ·
维护者通常 1 天内回复
-
The "MarkedForUpdate" property on %IPM.Storage.ResourceReference should have XMLPROJECTION = "NONE"未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
intersystems/ipm#1248 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
intersystems/ipm#1241 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
intersystems/ipm#1236 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
melgarafael/DeskcommCRM#3000 ·
维护者通常 1 天内回复
-
OFN writer emits `DocIRI` as a bare IRI, which becomes a version IRI or a parse error on re-read未关闭
难度 2/5 1-3 小时 新手友好度 72/100
phillord/horned-owl#338 ·
维护者通常 1 天内回复
-
ai-driven-qa bug Cosmetic
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100