Attachments in shared notes are deleted after adding a category
Bug Description When a shared note is categorized by the recipient (without changing ownership), all attachments (e.g., images, videos) within the note are deleted from the server. This issue occurs specifically when the shared user modifies the note's category.
Steps to reproduce User A creates a note with attachments (e.g., images, videos) in the Notes app. User A shares the note with User B. User B changes the category of the shared note (e.g., assigns it to "Work" or "Personal"). Check the note content after the category change.
Expected behaviour The note and its attachments (images, videos, etc.) should remain intact when the recipient changes the category of a shared note.
Actual behaviour Attachments within the note are deleted from the server, and the note no longer displays them. A "Failed to load" error appears for the missing attachments.
is anyone have idea for this ?
I can reproduce. Whenever a note is shared to someone and the person edits the category, attachments get broken for whatever reason
A request is made to /index.php/apps/text/attachments to get attachments with a payload of format:
{
"documentId": 470,
"sessionId": 260,
"sessionToken": "sTCZxevlh3zodXl9efSOKEkxRxshcIS8YmeroY30UvoKBh6Zp86f7V2sK+PW9Dol",
"shareToken": null
}
Initially, we get results:
[{"fileId":482,"name":"Nextcloud_Server_Administration_Manual.pdf","size":"8.4 MB","mimetype":"application\/pdf","mtime":1745697220,"isImage":false,"davPath":null,"fullUrl":"http:\/\/nextcloud.local\/index.php\/apps\/text\/media?documentId=470&sessionId=260&sessionToken=sTCZxevlh3zodXl9efSOKEkxRxshcIS8YmeroY30UvoKBh6Zp86f7V2sK%2BPW9Dol&mediaFileName=Nextcloud_Server_Administration_Manual.pdf","previewUrl":"http:\/\/nextcloud.local\/index.php\/apps\/text\/mediaPreview?documentId=470&sessionId=260&sessionToken=sTCZxevlh3zodXl9efSOKEkxRxshcIS8YmeroY30UvoKBh6Zp86f7V2sK%2BPW9Dol&mediaFileName=Nextcloud_Server_Administration_Manual.pdf"},{"fileId":472,"name":"img.png","size":"333 KB","mimetype":"image\/png","mtime":1745716256,"isImage":true,"davPath":null,"fullUrl":"http:\/\/nextcloud.local\/index.php\/apps\/text\/image?documentId=470&sessionId=260&sessionToken=sTCZxevlh3zodXl9efSOKEkxRxshcIS8YmeroY30UvoKBh6Zp86f7V2sK%2BPW9Dol&imageFileName=img.png&preferRawImage=1","previewUrl":"http:\/\/nextcloud.local\/index.php\/apps\/text\/image?documentId=470&sessionId=260&sessionToken=sTCZxevlh3zodXl9efSOKEkxRxshcIS8YmeroY30UvoKBh6Zp86f7V2sK%2BPW9Dol&imageFileName=img.png"}]
After the catagory update, the response is empty
Related to https://github.com/nextcloud/notes/issues/941
Related to #941
Yes, it was fixed in the old version, but the issue still persists in the new version. Also, the problem described in #1502 continues to be a major issue for us.
Also, the problem described in #1502 continues to be a major issue for us.
This got fixed, btw @mserwan
Whenever a note is shared to someone and the person edits the category, attachments get broken for whatever reason
Likely because the target folder for attachments is got using: $this->noteUtil->getCategoryFolder($notesFolder, $note->getCategory()). So attachments are stored in the same category folder as the note (same directory).