Collection-index refresh returns HTTP 500 because the service method is missing
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript
調査の方向性
Start with app/controllers/collection-indexes-controller.js around line 120, then read app/services/stix/collection-indexes-service.js and its base classes to trace the missing refresh entry point. Add regression coverage for newer and unchanged remote content, unknown IDs, missing URLs, and remote failures; done means POST /api/collection-indexes/{id}/refresh no longer returns this TypeError and updates the database only when appropriate.
索引モデルが issue の本文から書いたものです。
説明
Summary
POST /api/collection-indexes/{id}/refresh calls collectionIndexService.refresh(id), but neither CollectionIndexesService nor its base classes implement refresh. The endpoint returns HTTP 500 before looking up the index or fetching its remote URL.
Observed on REST API 4.24.0, commit 69b37fe769e6abe7675d413451a8361aecc36bea.
Reproduction
- Authenticate with an editor or administrator session.
- Create a collection index.
- Send
POST /api/collection-indexes/{id}/refresh.
Server logs:
[ERROR] Failed with error: TypeError: collectionIndexService.refresh is not a function
[HTTP] POST /api/collection-indexes/bc94bee0-f775-47cb-b93a-cb6171ba58a5/refresh 500
The controller catches the exception; the API continued serving requests afterward.
Expected behavior
Retrieve the index from workspace.remote_url and update the database when the remote index is newer. Handle unknown IDs, missing URLs, and remote failures explicitly.
Relevant implementation
Implement single-index refresh and add regression coverage for newer/unchanged remote content and error cases.
- 主要言語
- JavaScript
- スター
- 56
- フォーク
- 18
- 平均マージ
- 19時間 39分
- マージ済み PR(30日)
- 7
環境構築
- 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 が 20 日前に担当しました。 オープン
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
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
521xueweihan/HelloGitHub#4237 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
bug confirmed js v6
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
area/frontend area/v2 kind/bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信