Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

If-Overwritten-Version header not enforced when accessed via TinyNode

未关闭
#230 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript
领域
api, backend

调研方向

从 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

  1. Load an object via store.rerum.io/v1/id/{id} - note __rerum.isOverwritten (e.g., 2025-11-30T20:31:57.853)
  2. Send /overwrite to tiny.rerum.io - this updates isOverwritten to new value
  3. Send another /overwrite to tiny.rerum.io with header If-Overwritten-Version: 2025-11-30T20:31:57.853 (old value)
  4. Expected: 409 Conflict
  5. Actual: 200 OK, silent overwrite

Questions

  1. Does TinyNode pass through the If-Overwritten-Version header to RERUM?
  2. Is the optimistic locking check implemented in TinyNode or expected to be handled by RERUM?
  3. Is there a configuration needed to enable this feature?

Related

主要语言
JavaScript
星标
3
派生
6
平均合并
3 天 12 小时
30 天内合并 PR
4

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CenterForDigitalHumanities/rerum_server_nodejs 的其他 Issue

查看 CenterForDigitalHumanities/rerum_server_nodejs 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。