Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

GET /collections ignores the documented offset parameter

オープン
#512 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript
領域
api, backend

調査の方向性

Start with app/controllers/collections-controller.js and app/repository/collections-repository.js, where the issue identifies the offset/skip mismatch. Add regression tests comparing paged collection identities with an unpaged baseline for nonzero and beyond-end offsets, unlimited results, and latest/all revision selection; done means the pages return distinct collections and the specified offset behavior holds when limit is 0.

索引モデルが issue の本文から書いたものです。

説明

Verified on REST API 4.24.0, commit 69b37fe769e6abe7675d413451a8361aecc36bea.

Reproduction and impact

Create three valid collections matching a unique search term. Request:

GET /api/collections?search=UNIQUE_TERM&limit=1&offset=0
GET /api/collections?search=UNIQUE_TERM&limit=1&offset=1
GET /api/collections?search=UNIQUE_TERM&limit=1&offset=2
GET /api/collections?search=UNIQUE_TERM&limit=1&offset=3

Every request returns the same first collection. Unpaged baselines before and after match. limit=0&offset=1 also returns all three instead of the final two. Collection GET returns an array; no includePagination parameter is needed.

This reproduces through direct HTTP requests. Repeated pages prevent traversal of the matching collections.

Root cause and expected fix

The controller supplies options.offset, but the repository checks options.skip. Nothing translates between them.

Use the documented offset after filtering/version grouping and before limiting. Offsets 0–2 should return distinct collections; offset 3 should return []. Apply offset even when limit=0.

Add regression tests comparing page identities with an unpaged baseline, including nonzero/beyond-end offsets, unlimited results, and latest/all revision selection. This is separate from collection creation #505 and index refresh #506.

主要言語
JavaScript
スター
57
フォーク
18
平均マージ
1日 26分
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

mitre-attack/attack-workbench-rest-api のほかの issue

mitre-attack/attack-workbench-rest-api の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。