Well-known files route returns a false 503 for non-storage-program anchors

Đang mở Phù hợp với người mới
#286 1 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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
node.js, typescript
Lĩnh vực
api, backend, testing

Hướng nghiên cứu

Đọc reference-implementations/dacs-directory/app/api/dacs/wellknown-files/route.ts và src/catalog/chain.ts, sau đó kiểm tra test/wellknown-files-route.test.ts. Xem route xử lý các anchor locator không thuộc chương trình lưu trữ như thế nào so với trường hợp node không trả về kết quả. Thêm trường hợp liệt kê dựa trên fixture và xác minh rằng trường hợp này trả về lỗi không thể thử lại, trong khi phản hồi vắng mặt từ node vẫn trả về 503.

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

Mô tả

contributors-section

Where: reference-implementations/dacs-directory/app/api/dacs/wellknown-files/route.ts:38 (on phase0-completion at the linked commit)

What goes wrong: For a listing whose anchor locator is not a stor- plus 40 hex characters address (for example the demo fixture seller), readAnchorResult (src/catalog/chain.ts:79) returns absent without calling the node. The route (route.ts:41-46) then answers 503 with 'the node reports no storage program at the anchor'. No node was asked, so the message is wrong, and 503 invites retries that can never succeed.

Suggested fix: Before the read at route.ts:38, check the locator against ^stor-[0-9a-f]{40}$ (or the anchor kind) and refuse with an accurate, non-retryable error that says the anchor is not a storage-program address, so the index cannot be generated from chain state. Do not use 503 for this case, and keep the existing 503 for an absent answer from the node. Add a test with a fixture-anchored listing to test/wellknown-files-route.test.ts.

Size: Small

This comes from a code review, not from a failing run, so please confirm it before starting. Send the fix as a pull request to phase0-completion. It merges once tests pass and a maintainer has approved it.

Ngôn ngữ chính
TypeScript
Star
0
Fork
3
Merge trung bình
20 giờ 26 phút
Pull request đã merge (30 ngày)
119

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 DACS-Agent-commerce/Community

Tất cả issue của DACS-Agent-commerce/Community

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.