deck icon indicating copy to clipboard operation
deck copied to clipboard

Deck 1.3.0: File-attachments not deletable via API

Open desperateCoder opened this issue 4 years ago • 6 comments

Update

It's just missing in the docs that an additional optional query param called type must be passed in order to delete file attachments. type can have deck_file (default) or file as value. The latter is required for file attachments which are available since Deck 1.3.0


Original 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 The Android Deck App has issues deleting attachments of type file. We call the good old documented delete path, but the API refuses to do anything.

According to the documentation, we call the API as follows:

 @DELETE("v1.0/boards/{boardId}/stacks/{stackId}/cards/{cardId}/attachments/{attachmentId}")
    Observable<Void> deleteAttachment(@Path("boardId") long boardId, @Path("stackId") long stackId, @Path("cardId") long cardId, @Path("attachmentId") long attachmentId);

To Reproduce Steps to reproduce the behavior:

  1. In Android Deck app, open a card with file-type attachment(s)
  2. Go to the attachments tab
  3. long-press on a file-type attachment
  4. select delete
  5. see that it doesn't work

Expected behavior Attachment should be deleted.

Nextcloud version: 21

Deck version: 1.3.0

CC: @stefan-niedermann

desperateCoder avatar Mar 20 '21 20:03 desperateCoder

@desperateCoder we hid the "delete" menu item in the currently published version of the Android app for this reason to don't get any more reputation damage, so the steps to reproduce won't work. Though the struggle is real... the API really doesn't do anything.

Maybe it is useful if the Web UI would use the same REST-APIs as all other clients instead of the "private" /apps/deck/* endpoints so this kind of errors can get noticed earlier...?

stefan-niedermann avatar Mar 20 '21 21:03 stefan-niedermann

@juliushaertl did you already had some time to look into this?

stefan-niedermann avatar May 15 '21 06:05 stefan-niedermann

I narrowed down the issue a bit via Holzhammer-Debugging: The AttachmentApiController#delete method seems to not recognize a type query parameter.

This leads to defaulting to deck_file which won't work given the IDs are not the same of course.

I have looked long around how the query parameters eventually go into this method, but it looks like this is some kind of magic. Query params aren't present in the routes.php file either.

@desperateCoder Maybe we can double-proof this via a curl command?

stefan-niedermann avatar Jan 21 '24 16:01 stefan-niedermann

Hi, joining this issue. I've open a related issue on Deck Android https://github.com/stefan-niedermann/nextcloud-deck/issues/1562 Hope this can be solved, this is an important feature.

Thanks a lot to all dev's for the work.

wargreen avatar Jan 21 '24 20:01 wargreen

Alright, looks like passing the query param type=file works. Transforming this issue into a documentation task.

@wargreen Deck Android will ship a fix with 1.24.0.

stefan-niedermann avatar Jan 22 '24 07:01 stefan-niedermann

Noobie question here : Is it working for files, link to files and directory in NC ?

wargreen avatar Jan 22 '24 15:01 wargreen