Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#230 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu với controllers/overwrite.js và lần theo đường đi của request /overwrite, sau đó so sánh với cách TinyNode xử lý /overwrite và issue 106 liên quan của TinyNode. Xác minh xem If-Overwritten-Version có đến được máy chủ RERUM hay không và các giá trị không khớp có tạo ra 409 Conflict thay vì 200 OK hay không. Được xem là hoàn tất khi hành vi optimistic-locking được ghi nhận trong tài liệu được thực thi hoặc khi khoảng trống trong tích hợp/cấu hình được xác định rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
JavaScript
Star
3
Fork
6
Merge trung bình
4 ngày 9 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CenterForDigitalHumanities/rerum_server_nodejs

Tất cả issue của CenterForDigitalHumanities/rerum_server_nodejs

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.