Technique/tactic association pagination reports page length as total
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- api
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- JavaScript
- 星标
- 57
- 派生
- 18
- 平均合并
- 1 天 26 分钟
- 30 天内合并 PR
- 7
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
mitre-attack/attack-workbench-rest-api 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 2/5 1-3 小时 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 86/100
-
难度 3/5 1-2 天 新手友好度 74/100
-
难度 3/5 1-2 天 新手友好度 68/100
查看 mitre-attack/attack-workbench-rest-api 的全部 Issue
相似的 Issue
-
triage-needed
难度 2/5 1-3 小时 新手友好度 76/100
MicrosoftDocs/edge-developer#3970 ·
维护者通常 1 天内回复
-
agent/scanner hive/hosted-available-lke648397-260827-5n31 quality testing
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
PWA stores a grouped number entry 1000x too small in German locale可能已有人在做 @Minhal128 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Add: YRF Music未关闭check:passed feeds:add
难度 2/5 1-3 小时 新手友好度 68/100
iptv-org/database#37102 · 2 条评论 ·
维护者通常 9 天内回复
-
[workshop-sim] Repair: Add a fallback sample .lock.yml to the Agentic Workflows Intro Activity 1未关闭feedback simulation workshop
难度 2/5 1-3 小时 新手友好度 72/100
githubnext/gh-aw-workshop#4328 ·
维护者通常 1 天内回复