Skip to content

fix(recording): fix recipient share path and stale token guards - #18043

Closed
miaulalala wants to merge 1 commit into
mainfrom
fix/recording-conversation-folder
Closed

miaulalala wants to merge 1 commit into
mainfrom
fix/recording-conversation-folder

Conversation

@miaulalala

@miaulalala miaulalala commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Root cause fix — recipient share path (Share/Listener.php)

overwriteShareTarget() computes the file_target for TYPE_ROOM shares. With conversation subfolders enabled it uses the full relative path from the attachment root for any file that happens to live under Talk/. This caused recordings at Talk/Recording/<token>/recording.mp4 to be mounted as Talk/Recording/<token>/recording.mp4 in every recipient's files — the meaningless token folder is confusing and was not present before subfolders were introduced.

Fix: only keep the full relative path when the first path segment after the attachment folder matches the conversation folder pattern (<name>-<token>). The recording folder (Recording/) does not match, so it falls back to the flat filename — recipients see the recording at Talk/recording.mp4, same as before subfolders.

Additional bug fixes

  • Wrong preference reset (getRecordingFolder()): was resetting UserPreference::ATTACHMENT_FOLDER when the recording root was a shared folder; must reset UserPreference::RECORDING_FOLDER.
  • storeTranscript() name guard: $recordingFolder->getName() !== $roomToken throws once a recording has been moved to a path whose parent is not the token. Removed.
  • notifyAboutFailedTranscript() name guard: same stale guard, same fix.

Test plan

  • 14 unit tests pass (RecordingServiceTest)
  • Two new Behat steps: has file at path / has no file at path (WebDAV PROPFIND + ROOM() resolution)
  • "Store recording with success and create transcript" scenario asserts the recording remains at Talk/Recording/<token>/ from the owner's perspective after sharing
  • Integration: share a recording to chat with subfolders enabled — recipient should see the file at Talk/recording.mp4, not Talk/Recording/<token>/recording.mp4

🤖 Generated with Claude Code

@miaulalala
miaulalala marked this pull request as draft May 20, 2026 08:38
@miaulalala
miaulalala force-pushed the fix/recording-conversation-folder branch from b2d00a0 to 2c5953a Compare May 20, 2026 09:12
@miaulalala miaulalala changed the title fix(recording): store recordings in conversation subfolder fix(recording): move recording to attachment root on share; fix shared-folder reset May 20, 2026
@miaulalala miaulalala self-assigned this May 20, 2026
@miaulalala miaulalala added this to the ⛅ Next Major (35) milestone May 20, 2026
@miaulalala

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@miaulalala
miaulalala force-pushed the fix/recording-conversation-folder branch 2 times, most recently from b62200f to a2a46d9 Compare May 20, 2026 09:54
@miaulalala miaulalala changed the title fix(recording): move recording to attachment root on share; fix shared-folder reset fix(recording): fix shared-folder reset and remove stale token guards May 20, 2026
@miaulalala
miaulalala force-pushed the fix/recording-conversation-folder branch from a2a46d9 to a88acf8 Compare May 20, 2026 10:02
@miaulalala miaulalala changed the title fix(recording): fix shared-folder reset and remove stale token guards fix(recording): fix recipient share path and stale token guards May 20, 2026
Comment thread lib/Service/RecordingService.php
@miaulalala
miaulalala requested a review from nickvergessen May 20, 2026 11:12
… are enabled

With conversation subfolders enabled, overwriteShareTarget() used the full
relative path from the attachment root for any TYPE_ROOM share, including
recordings stored at Talk/Recording/<token>/. Recipients would then see the
recording mounted at Talk/Recording/<token>/ in their own files, with a
meaningless token directory.

Fix: only use the full relative path when the first path segment after the
attachment folder matches the conversation folder pattern (<name>-<token>).
The Recording/ directory does not match, so it falls back to the flat
filename and recipients see the recording at Talk/recording.mp4.

AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
@miaulalala
miaulalala force-pushed the fix/recording-conversation-folder branch from a88acf8 to b14bfb6 Compare May 20, 2026 13:13
@miaulalala
miaulalala marked this pull request as ready for review May 20, 2026 13:15
@nickvergessen

Copy link
Copy Markdown
Member

Fixed via #18047

@nickvergessen
nickvergessen deleted the fix/recording-conversation-folder branch May 22, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants