GET /recent-activity applies filters after limiting and truncates pagination with incorrect totals
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript
調査の方向性
api/recent-activityエンドポイントから始めて、ユーザー検索と結果の上限が現在どのように適用されているかを確認してください。結果を制限する前にユーザーのフィルタリングが行われていることを確認してください。完了の基準は、上限によって一致する結果が除外されることなく、エンドポイントが一致する最近のアクティビティを返すことです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- JavaScript
- スター
- 57
- フォーク
- 18
- 平均マージ
- 21時間 30分
- マージ済み PR(30日)
- 8
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
-
Add ADM validation bypass for server-controlled fields on non-compliant objects対応中かも @seansica が 3 日前に担当しました。 オープン
mitre-attack/attack-workbench-rest-api#517 · 担当者 1 名 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
mitre-attack/attack-workbench-rest-api#512 · コメント 1 件 ·
mitre-attack/attack-workbench-rest-api の issue をすべて見る
似ている issue
-
bug/1-unconfirmed kind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
521xueweihan/HelloGitHub#4010 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
BUG
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
[BUG]: filesystem-edit-file converts a CRLF file's line endings to LF on every edit対応中かも @MohammadHijjawi97 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Mintplex-Labs/anything-llm#6755 ·
メンテナーはふだん 1 日以内に返信