If-Overwritten-Version header not enforced when accessed via TinyNode
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
从 controllers/overwrite.js 开始,跟踪 /overwrite 请求路径,然后将其与 TinyNode 对 /overwrite 的处理以及相关的 TinyNode issue 106 进行比较。验证 If-Overwritten-Version 是否到达 RERUM 服务器,以及不匹配的值是否产生 409 Conflict 而不是 200 OK。已完成的标准是:文档所述的乐观锁行为得到执行,或明确识别出集成/配置缺口。
由索引模型根据 Issue 内容生成。
描述
Summary
The If-Overwritten-Version header for optimistic locking is documented in the RERUM API but does not appear to be enforced when /overwrite requests come through TinyNode (tiny.rerum.io).
Background
According to the RERUM API documentation and the server code in controllers/overwrite.js, the If-Overwritten-Version header should be checked against __rerum.isOverwritten to detect concurrent edit conflicts.
The server code shows this logic:
const expectedVersion = req.get('If-Overwritten-Version') ?? req.body.__rerum?.isOverwritten
const currentVersionTS = originalObject.__rerum?.isOverwritten ?? ""
if (expectedVersion !== undefined && expectedVersion !== currentVersionTS) {
// Should return 409 Conflict
}
The Problem
When accessing RERUM through TinyNode (tiny.rerum.io/overwrite), the If-Overwritten-Version header is sent correctly but the version check is not enforced - requests succeed even with version mismatches.
Steps to Reproduce
- Load an object via
store.rerum.io/v1/id/{id}- note__rerum.isOverwritten(e.g.,2025-11-30T20:31:57.853) - Send
/overwritetotiny.rerum.io- this updatesisOverwrittento new value - Send another
/overwritetotiny.rerum.iowith headerIf-Overwritten-Version: 2025-11-30T20:31:57.853(old value) - Expected: 409 Conflict
- Actual: 200 OK, silent overwrite
Questions
- Does TinyNode pass through the
If-Overwritten-Versionheader to RERUM? - Is the optimistic locking check implemented in TinyNode or expected to be handled by RERUM?
- Is there a configuration needed to enable this feature?
Related
- TinyNode issue: https://github.com/CenterForDigitalHumanities/TinyNode/issues/106
- RERUM API docs: https://store.rerum.io/v1/API.html#overwrite
- 主要语言
- JavaScript
- 星标
- 3
- 派生
- 6
- 平均合并
- 3 天 12 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CenterForDigitalHumanities/rerum_server_nodejs 的其他 Issue
-
bug documentation
难度 2/5 1-3 小时 新手友好度 88/100
-
backend dependencies easy
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 82/100
CenterForDigitalHumanities/rerum_server_nodejs#290 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 50/100
-
难度 3/5 1-2 天 新手友好度 74/100
查看 CenterForDigitalHumanities/rerum_server_nodejs 的全部 Issue
相似的 Issue
-
release:v5.34
难度 1/5 1 小时以内 新手友好度 90/100
Jason-Vaughan/TangleClaw#2469 · 1 条评论 ·
维护者通常 1 天内回复
-
hacktoberfest help wanted skip-changelog
难度 2/5 1-3 小时 新手友好度 85/100
wassim-azi/agy-powerline#74 ·
维护者通常 1 天内回复
-
tests
难度 2/5 1-3 小时 新手友好度 82/100
smonn/validator-fns#741 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复