RFC: Safe partial-update behavior for PUT-only APIs

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript

Hướng nghiên cứu

Start with the CLI update command and the GET, merge, then PUT flow described in the issue, then inspect endpoint schemas and available concurrency tokens. Resolve the safety policy before implementation; done means the supported policy is documented and eligible endpoints have concurrency and failure-path tests, including dry-run secret handling.

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

Mô tả

enhancement priority: p2

Context

Some APIs expose replacement-oriented PUT operations but no PATCH operation. Users may still expect a CLI update command to preserve fields they did not specify.

A generic GET, merge, then PUT flow could emulate a partial update, but it can also overwrite concurrent changes or mishandle fields whose omission, null, empty value, or server default have different meanings.

Questions to resolve

  • Which endpoints have a concurrency token such as an ETag or version?
  • Can replacement schemas distinguish omitted fields from explicit clearing?
  • Which operations are idempotent and safe to retry?
  • How should secrets, write-only fields, computed fields, and server defaults be handled?
  • Should emulation be opt-in, endpoint-specific, or rejected when safety cannot be proven?

Safety requirements

  • Do not perform an unguarded read-modify-write when concurrent changes can be lost.
  • Preserve explicit clearing and replacement semantics.
  • Fail before mutation when the current representation cannot be reconstructed safely.
  • Show the effective request through dry-run without exposing secrets.

Outcome

Document the supported policy and implement it only for endpoints that satisfy the agreed safety constraints, with concurrency and failure-path tests.

Ngôn ngữ chính
TypeScript
Star
993
Fork
65
Merge trung bình
21 giờ 40 phút
Pull request đã merge (30 ngày)
211

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 cloudflare/cf

Tất cả issue của cloudflare/cf

Issue tương tự

Thêm issue về TypeScript

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.