Skip to content

fix(files_sharing): Make sure mount events are dispatched for share recipients - #64715

Open
marcelklehr wants to merge 6 commits into
masterfrom
test/share-mount-events
Open

marcelklehr wants to merge 6 commits into
masterfrom
test/share-mount-events

Conversation

@marcelklehr

@marcelklehr marcelklehr commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Summary

For user shares and group shares, creating a share should dispatch a UserMountAddedEvent for the recipient's share mount, and deleting it should dispatch a UserMountRemovedEvent. These tests only asks for this "at the latest when the recipient next loads their file system". Each case runs twice:

  • Immediate update (cutoff -1, the normal case): all 4 fail, because no event is ever dispatched.
  • Deferred update (cutoff 0, recipient marked for refresh): all 4 pass.

TODO

  • Fix this

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Comment thread apps/files_sharing/tests/ShareMountEventsTest.php Outdated
Comment thread apps/files_sharing/tests/ShareMountEventsTest.php Outdated
Comment thread apps/files_sharing/tests/ShareMountEventsTest.php Outdated
Comment thread apps/files_sharing/tests/ShareMountEventsTest.php Outdated
Comment thread apps/files_sharing/tests/ShareMountEventsTest.php Outdated
Comment thread apps/files_sharing/tests/ShareMountEventsTest.php
Comment thread apps/files_sharing/tests/ShareMountEventsTest.php Outdated
@marcelklehr

Copy link
Copy Markdown
Member Author

/backport to stable34

@marcelklehr

Copy link
Copy Markdown
Member Author

/backport to stable35

@marcelklehr
marcelklehr marked this pull request as ready for review September 30, 2026 12:47
@marcelklehr
marcelklehr requested a review from a team as a code owner September 30, 2026 12:47
@marcelklehr
marcelklehr requested review from Altahrim, come-nc, icewind1991 and salmart-dev and removed request for a team September 30, 2026 12:47
@marcelklehr marcelklehr changed the title test(files_sharing): Check mount events are dispatched for share recipients fix(files_sharing): Check mount events are dispatched for share recipients Sep 30, 2026
@marcelklehr marcelklehr changed the title fix(files_sharing): Check mount events are dispatched for share recipients fix(files_sharing): Make sure mount events are dispatched for share recipients Sep 30, 2026
@come-nc
come-nc removed their request for review October 5, 2026 10:04
@marcelklehr
marcelklehr force-pushed the test/share-mount-events branch from 1fab2bc to 3db8e5f Compare October 19, 2026 06:45

@susnux susnux 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.

Looks good to me, but a second review of @salmart-dev or @icewind1991 would be good!

@salmart-dev salmart-dev 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.

Please add test assertions that cover that the lazy-loaded data is present if you keep the new class.

Comment thread lib/private/Files/Config/LazyCallbackStorageMountInfo.php Outdated
Comment thread lib/private/Files/Config/UserMountCache.php Outdated
$this->share($shareType, self::FOLDER, self::TEST_FILES_SHARING_API_USER1, $recipient, Constants::PERMISSION_ALL);
$this->getUserFolder(self::TEST_FILES_SHARING_API_USER2)->get(self::FOLDER);

$this->assertContains(

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.

fix: this lets duplicate events go unnoticed, the exact amount of expected events should be checked

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

imo having duplicate events is fine.

Comment thread lib/private/Files/Config/UserMountCache.php Outdated
Comment thread lib/private/Files/Config/UserMountCache.php Outdated
Comment thread lib/private/Files/Config/UserMountCache.php Outdated
Comment thread lib/private/Files/Config/LazyCallbackStorageMountInfo.php Outdated
Comment thread lib/private/Files/Config/UserMountCache.php
…pients

Apps keep per-user data in sync with file access by listening to
UserMountAddedEvent and UserMountRemovedEvent. When a share is created or
deleted, these events should reach the recipient at the latest when the
recipient next sets up their file system.

Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@icewind1991
icewind1991 force-pushed the test/share-mount-events branch 4 times, most recently from 3452131 to 07be8cd Compare October 23, 2026 14:05
icewind1991 and others added 4 commits October 23, 2026 16:08
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991
icewind1991 force-pushed the test/share-mount-events branch from 07be8cd to 8c8b57c Compare October 23, 2026 14:08

This branch has not been deployed

No deployments
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.

6 participants