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}/clone request.
- Call the Pinia
cloneBoard action.
- Observe that
BoardApi.cloneBoard() returns the Axios error.
- Observe that the action processes it as
newBoard and 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
main branch
- 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.
How to use GitHub
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 tothis.boards. The store action's owncatchblock is not reached because the API method resolved with the error object.This was found by reviewing the current
mainbranch. A focused unit test should be sufficient to reproduce it by mocking a rejected clone request.To Reproduce
POST /boards/{boardId}/clonerequest.cloneBoardaction.BoardApi.cloneBoard()returns the Axios error.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
mainbranch.Client details:
mainbranchServer 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:
A regression test should verify that a rejected clone request leaves
boardsunchanged and reaches the store action's error path.