GET /recent-activity applies filters after limiting and truncates pagination with incorrect totals
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
Hướng nghiên cứu
Bắt đầu từ endpoint api/recent-activity và kiểm tra cách tìm kiếm người dùng và giới hạn kết quả hiện được áp dụng. Xác nhận rằng việc lọc người dùng diễn ra trước khi giới hạn kết quả; hoàn tất có nghĩa là endpoint trả về hoạt động gần đây khớp mà không loại trừ các kết quả khớp do giới hạn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Replacement title and description for REST API issue #351. Verified on REST API 4.24.0, commit 69b37fe769e6abe7675d413451a8361aecc36bea.
Reproduction and impact
Create three techniques with distinct modified timestamps in an instance containing older relationship activity. Confirm the techniques occupy the first three entries:
GET /api/recent-activity?limit=3&offset=0&includePagination=true
Request the same endpoint with limit=1 at offsets 0, 1 and 2. In the verified reproduction, offset zero returned the newest technique; offset one skipped two newer techniques and returned an older relationship; offset two was empty. All reported total=2.
The three-entry baseline stayed unchanged before and after the probes. Changing only limit from 1 to 2, 3 and 10 changed reported total to 2, 4, 6 and 20. Direct HTTP requests reproduce the defect without an updater filter.
Root cause and expected fix
The repository applies $sort, $limit, then $match separately to objects and relationships. This can discard matching updater activity. The service paginates the merged, truncated candidates again and uses their length as total.
Apply updater and revoked/deprecated selection before limiting; count the complete matching population independently; globally order results and select the requested page. For bounded requests, fetch enough filtered candidates from each collection for offset + limit, then merge and slice. Preserve unlimited limit=0 behavior. Moving filtering before the current early limit alone leaves pagination broken.
Regression tests should cover mixed objects/relationships, successive pages, totals invariant across limits/offsets, older matching updater records behind newer nonmatches, revoked/deprecated selection, and timestamp ties. Compare (id, modified) identities using stable fixtures. Pages should traverse every matching record in order, and totals should remain correct beyond the end.
- Ngôn ngữ chính
- JavaScript
- Star
- 56
- Fork
- 18
- Merge trung bình
- 21 giờ 14 phút
- Pull request đã merge (30 ngày)
- 10
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
mitre-attack/attack-workbench-rest-api#513 ·
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 86/100
mitre-attack/attack-workbench-rest-api#505 ·
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 86/100
mitre-attack/attack-workbench-rest-api#499 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add ADM validation bypass for server-controlled fields on non-compliant objectsCó thể đã có người làm @seansica đã nhận 15 ngày trước. Đang mở
mitre-attack/attack-workbench-rest-api#517 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
mitre-attack/attack-workbench-rest-api#512 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
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 76/100
Graphify-Labs/graphify#4860 · 1 bình luận ·
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 65/100
CommandCodeAI/command-code#1088 ·
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 78/100
CanadaHonk/porffor#426 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
RIT-Software-Engineering/RIT-SE-Senior-Project#546 ·
Maintainer thường phản hồi trong vòng 1 ngày