Skip to content

fix(sharing): Allow sharing with read-write again#18485

Merged
nickvergessen merged 2 commits into
mainfrom
bugfix/18354/allow-sharing-with-update-permissions
Jul 1, 2026
Merged

fix(sharing): Allow sharing with read-write again#18485
nickvergessen merged 2 commits into
mainfrom
bugfix/18354/allow-sharing-with-update-permissions

Conversation

@nickvergessen

Copy link
Copy Markdown
Member

β˜‘οΈ Resolves

  • Fix #…

Tested with:

diff --git a/src/services/filesSharingServices.ts b/src/services/filesSharingServices.ts
index 756644149a..d6fc9866c3 100644
--- a/src/services/filesSharingServices.ts
+++ b/src/services/filesSharingServices.ts
@@ -77,7 +77,7 @@ async function createNewFile({ filePath, templatePath, templateType }: createFil
  *         and a rename simulation for the requested file names.
  */
 async function probeAttachmentFolder({ token, fileNames }: { token: string } & ProbeAttachmentFolderParams): ProbeAttachmentFolderResponse {
-       return axios.post(generateOcsUrl('apps/spreed/api/v1/chat/{token}/attachment/folder', { token }), { fileNames })
+       return axios.post(generateOcsUrl('apps/spreed/api/v1/chat/{token}/attachment/folder', { token }), { fileNames, allowUpdate: true })
 }
 
 /**
@@ -106,6 +106,7 @@ async function postAttachment({ token, filePath, fileName, referenceId, talkMeta
                fileName,
                referenceId,
                talkMetaData,
+               allowUpdate: true,
        })
 }
 

πŸ› οΈ API Checklist

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not possible
  • πŸ“˜ API documentation in docs/ has been updated or is not required
  • πŸ”– Capability is added or not needed

@nickvergessen nickvergessen added this to the β›… Next Major (35) milestone Jun 29, 2026
@nickvergessen nickvergessen self-assigned this Jun 29, 2026
@nickvergessen nickvergessen added bug feature: api πŸ› οΈ OCS API for conversations, chats and participants feature: upload & shares & voice πŸ“€πŸŽ™οΈ Sharing files into a chat and audio recordings labels Jun 29, 2026
Comment thread lib/Config.php Outdated
Comment thread lib/Controller/ChatController.php
@nickvergessen nickvergessen force-pushed the bugfix/18354/allow-sharing-with-update-permissions branch 2 times, most recently from f2981d7 to b0670ac Compare June 30, 2026 13:12

@Antreesy Antreesy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested

@nickvergessen

Copy link
Copy Markdown
Member Author
Run integration:                          tests/integration/features/sharing-1/conversation-folder.feature#L214                                                                                                  When user "participant3" probes  attachment folder for room "one-to-one room" with files  "rep<o>rt.txt,nul.txt,rep:o:rt.txt" with 200 (v1)  Type error: Too few arguments to function  SharingContext::sendingToTalkAttachmentFolderProbe(), 2 passed in  /home/runner/actions-runner/_work/spreed/spreed/apps/spreed/tests/integration/features/bootstrap/SharingContext.php  on line 139 and exactly 3 expected  (Behat\Testwork\Call\Exception\FatalThrowableError)
Run integration:                          tests/integration/features/sharing-1/conversation-folder.feature#L204                                                                                                  When user "participant1" probes  attachment folder for room "group room" with files "photo.jpg" with 200  (v1)  Type error: Too few arguments to function  SharingContext::sendingToTalkAttachmentFolderProbe(), 2 passed in  /home/runner/actions-runner/_work/spreed/spreed/apps/spreed/tests/integration/features/bootstrap/SharingContext.php  on line 139 and exactly 3 expected  (Behat\Testwork\Call\Exception\FatalThrowableError)
Run integration:                          tests/integration/features/sharing-1/conversation-folder.feature#L191                                                                                                  When user "participant1" probes  attachment folder for room "group room" with files "photo.jpg,  notes.txt" with 200 (v1)  Type error: Too few arguments to function  SharingContext::sendingToTalkAttachmentFolderProbe(), 2 passed in  /home/runner/actions-runner/_work/spreed/spreed/apps/spreed/tests/integration/features/bootstrap/SharingContext.php  on line 139 and exactly 3 expected  (Behat\Testwork\Call\Exception\FatalThrowableError)
Run integration:                          tests/integration/features/sharing-1/conversation-folder.feature#L172                                                                                                  When user "participant1" posts temp file  "unique.txt" with name "unique.txt" from conversation folder of room  "group room" with name "Group room" with 200 (v1)  Type error: Too few arguments to function  SharingContext::ensureDraftFolderViaProbe(), 2 passed in  /home/runner/actions-runner/_work/spreed/spreed/apps/spreed/tests/integration/features/bootstrap/SharingContext.php  on line 124 and exactly 3 expected  (Behat\Testwork\Call\Exception\FatalThrowableError)
Run integration:                          tests/integration/features/sharing-1/conversation-folder.feature#L163                                                                                                  When user "participant1" posts temp file  "temp-upload.txt" with name "test.txt" from conversation folder of room  "group room" with name "Group room" with 200 (v1)  Type error: Too few arguments to function  SharingContext::ensureDraftFolderViaProbe(), 2 passed in  /home/runner/actions-runner/_work/spreed/spreed/apps/spreed/tests/integration/features/bootstrap/SharingContext.php  on line 124 and exactly 3 expected  (Behat\Testwork\Call\Exception\FatalThrowableError)

Old tests need adjustments

Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen force-pushed the bugfix/18354/allow-sharing-with-update-permissions branch from b0670ac to 20944dd Compare July 1, 2026 05:39
@nickvergessen nickvergessen merged commit 599d434 into main Jul 1, 2026
83 of 86 checks passed
@nickvergessen nickvergessen deleted the bugfix/18354/allow-sharing-with-update-permissions branch July 1, 2026 16:30
@nickvergessen

Copy link
Copy Markdown
Member Author

/backport to stable34

@backportbot

backportbot Bot commented Jul 1, 2026

Copy link
Copy Markdown

The backport to stable34 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable34
git pull origin stable34

# Create the new backport branch
git checkout -b backport/18485/stable34

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick ea847752 20944dd7

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/18485/stable34

Error: Failed to create pull request: Validation Failed: {"resource":"PullRequest","code":"custom","message":"A pull request already exists for nextcloud:backport/18485/stable34."} - https://docs.github.com/rest/pulls/pulls#create-a-pull-request


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug feature: api πŸ› οΈ OCS API for conversations, chats and participants feature: upload & shares & voice πŸ“€πŸŽ™οΈ Sharing files into a chat and audio recordings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants