Board clone API failure is treated as a successful board response
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 88/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- frontend
調査の方向性
まず、src/services/BoardApi.js の146-159行付近と、src/stores/board.js の180-194行付近を確認します。拒否された POST /boards/{boardId}/clone リクエストをモックする、対象を絞ったユニットテストを実行または追加し、その後、拒否がストアアクションまで到達すること、ボードコレクションが変更されないこと、失敗が呼び出し元に公開されることを検証します。
索引モデルが issue の本文から書いたものです。
説明
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Describe the bug
When the board-clone request fails, BoardApi.cloneBoard() catches the Axios error and returns it instead of throwing it:
https://github.com/nextcloud/deck/blob/main/src/services/BoardApi.js#L146-L159
Returning the error resolves the promise. The Pinia action then treats that error as a successfully cloned board:
https://github.com/nextcloud/deck/blob/main/src/stores/board.js#L180-L194
Since an Axios error normally has no board id, it can be appended to this.boards. The store action's own catch block is not reached because the API method resolved with the error object.
This was found by reviewing the current main branch. A focused unit test should be sufficient to reproduce it by mocking a rejected clone request.
To Reproduce
- Mock or trigger a rejected
POST /boards/{boardId}/clonerequest. - Call the Pinia
cloneBoardaction. - Observe that
BoardApi.cloneBoard()returns the Axios error. - Observe that the action processes it as
newBoardand may append it to the board collection.
Expected behavior
A failed clone request should reject. The board collection should remain unchanged, and the caller/UI should receive the request failure.
Screenshots
Not applicable; this is an error-propagation issue found on the current main branch.
Client details:
- OS: Not environment-specific
- Browser: Not environment-specific
- Version: Current
mainbranch - Device: Desktop
Server details
Not environment-specific. The failure can be reproduced with a mocked rejected Axios request.
Logs
No server or browser logs are required when reproducing with a rejected Axios mock.
Suggested fix
Allow the Axios rejection to propagate, or rethrow the caught error:
} catch (err) {
throw err
}
A regression test should verify that a rejected clone request leaves boards unchanged and reaches the store action's error path.
- 主要言語
- JavaScript
- スター
- 1.4k
- フォーク
- 358
- 平均マージ
- 2日 18時間
- マージ済み PR(30日)
- 83
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nextcloud/deck のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
CSV export leaves trailing commas in tags and assigned-user fields対応中かも @Kumar-s75 が 38 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nextcloud/deck#8334 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
1. to develop bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nextcloud/deck#8146 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Date picker should automatically open popup対応中かも @theoholl が 46 日前に担当しました。 オープン1. to develop enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nextcloud/deck#8110 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug lsp sev-3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
Miaotofu01/Study-Mate#206 ·
メンテナーはふだん 1 日以内に返信
-
effort:low model:light plan planner:fable-5-1 test-quality tests
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
zhw2590582/ArtPlayer#1073 ·