Bundle bindings route repeats full-state parsing and full re-hashing on every request
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ó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- backend, performance
Hướng nghiên cứu
Start with reference-implementations/dacs-directory/app/api/dacs/bundles/[jobId]/route.ts, then read src/catalog/pagination.ts and test/catalog-binding-pagination.test.ts to understand the current page and cursor behavior. The issue calls for a per-job binding index or cache that avoids loading all scan state and re-hashing and sorting bindings on each page. Update the cost notes in README.md and src/catalog/contracts.ts; done means the existing cursor behavior is preserved and the pagination tests pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Where: reference-implementations/dacs-directory/app/api/dacs/bundles/[jobId]/route.ts:33 (on phase0-completion at the linked commit)
What goes wrong: Every GET /api/dacs/bundles/{jobId} calls loadScanState() (route.ts:33), which reads, parses and normalises the entire stored scan state only to look up one jobId, so the cost grows with the size of the whole state rather than the reply. In addition, every request with limit or cursor (route.ts:37) computes the content hash of every binding stored for the job and sorts them all in keysetPage (src/catalog/pagination.ts), then returns one page, so reading a large job in pages repeats that work on each page. The README (README.md:366-367) and the OpenAPI descriptions (src/catalog/contracts.ts:404-405) already warn that paged reads cost more than a plain read.
Suggested fix: Stop loading the full scan state per request: read only the bundle bindings, for example from a small separately stored or cached index keyed by jobId. Keep each job's bindings in content-hash order in that index (or cache the hash-ordered list per job) so a page is a slice instead of a full re-hash and sort. Keep the existing cursor behaviour (a page starts after the cursor key even if that binding is gone) and its tests in test/catalog-binding-pagination.test.ts. Then update the cost note in README.md:366-367 and src/catalog/contracts.ts:404-405 to match.
Size: Medium
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
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DACS-Agent-commerce/Community
-
Payment safety page: explain 'preimage' and 'claim' and name the cross-chain open state preciselyĐang mởcontributors-section
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DACS-Agent-commerce/Community#366 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
contributors-section
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
DACS-Agent-commerce/Community#361 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
contributors-section
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
DACS-Agent-commerce/Community#359 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
contributors-section
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
DACS-Agent-commerce/Community#354 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
OpenAPI entry for the listing version route omits its 409 responseCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởcontributors-section
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
DACS-Agent-commerce/Community#348 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của DACS-Agent-commerce/Community
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
siyuan-note/siyuan#21692 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
GetStream/stream-chat-react#3467 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
resend/resend-node#1206 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
cloudflare/cloudflare-typescript#2821 ·