Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Technique/tactic association pagination reports page length as total

Abierto
#511 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
JavaScript
Estrellas
57
Forks
18
Merge medio
1 d 26 min
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de mitre-attack/attack-workbench-rest-api

Todos los issues de mitre-attack/attack-workbench-rest-api

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.