Skip to content

test(files_sharing): Check mount events are dispatched for share recipients - #64715

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

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

Conversation

@marcelklehr

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

…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>
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
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
*/
private function setupFileSystem(string $userId): void {
$this->loginHelper($userId);
$this->rootFolder->getUserFolder($userId)->getDirectoryListing();

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.

Not necessary and also not the right way to setup the FS, which doesn't even need an explicit initialization.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If the FS doesn't need an explicit initialization, how would you have me test this behavior?

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.

To check if the mounts exist, just get the expected path from the user folder. After you verified that, you can check that the events fired.

Signed-off-by: Marcel Klehr <mklehr@gmx.net>

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.

3 participants