Technique/tactic association pagination reports page length as total
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/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ệ
- javascript
- Lĩnh vực
- api
Hướng nghiên cứu
Start with the pagination logic in app/services/stix/techniques-service.js around line 488 and app/services/stix/tactics-service.js around line 155, then compare it with Workbench's shared pagination behavior. Inspect the schemas for both endpoints and add regression tests for the listed pagination cases in both directions. Done means totals count all filtered associations and stay correct on empty beyond-end pages, with the pagination envelope documented.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Verified on REST API 4.24.0, commit 69b37fe769e6abe7675d413451a8361aecc36bea.
Reproduction and impact
Create three tactics and three techniques whose kill-chain phases associate every technique with all three tactics. Unpaged reads return three matches in each direction:
GET /api/techniques/TECHNIQUE_ID/modified/MODIFIED/tactics
GET /api/tactics/TACTIC_ID/modified/MODIFIED/techniques
Request each endpoint with limit=1&includePagination=true at successive offsets:
| Offset | Returned items | Actual total | Expected total |
|---|---|---|---|
| 0–2 | 1 distinct item per page | 1 | 3 |
| 3 | 0 | 0 | 3 |
Direct HTTP requests reproduce this with stable unpaged baselines. Filtering and slicing work, but the reported total incorrectly indicates that only one match exists when three are available.
Root cause and expected fix
Both techniques-service.js and tactics-service.js calculate total: pagedResults.length.
Count all filtered associations before slicing, consistent with Workbench's shared pagination behavior. Total should remain three across every page, including an empty beyond-end page. Document the pagination envelope in both endpoint schemas, which currently describe only array responses.
Add regression tests for both directions, page identities, invariant totals, zero matches, nonzero/beyond-end offsets, and limit=0. Related historical pagination feature: closed issue #221.
- Ngôn ngữ chính
- JavaScript
- Star
- 57
- Fork
- 18
- Merge trung bình
- 1 ngày 26 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không 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 mitre-attack/attack-workbench-rest-api
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của mitre-attack/attack-workbench-rest-api
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
developmentseed/deck.gl-raster#693 ·
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 72/100
iii-hq/iii#2278 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
[DevEx]: Playground specs are excluded from both GUI and CI, so videoPlayground is unreachableĐang mởdev experience
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cuttle-cards/cuttle#1413 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
macOS
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
beyondcode/herd-community#1761 ·