Skip to content

Conversation

@provokateurin
Copy link
Member

@provokateurin provokateurin commented Jan 13, 2025

Summary

Closes #49881

Checklist

@provokateurin provokateurin added the pending documentation This pull request needs an associated documentation update label Jan 20, 2025
@provokateurin provokateurin force-pushed the feat/mountmanager/emit-events branch from e3b1f01 to d8c889d Compare January 20, 2025 14:05
@provokateurin provokateurin changed the title feat(MountManager): Emit events when mounts are added, removed and moved feat(UserMountCache): Emit events for added, removed and updated mounts Jan 20, 2025
@provokateurin provokateurin requested a review from come-nc January 20, 2025 14:05
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

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

Small question but otherwise looks promising

@blizzz blizzz modified the milestones: Nextcloud 31, Nextcloud 32 Jan 29, 2025
@sorbaugh sorbaugh requested a review from come-nc February 3, 2025 10:39
@kyteinsky
Copy link
Contributor

hello,
Nice, these events should be exhaustive.

There are a few issues, however:

  1. files:scan or load/reload of the files page emits the UserMountAddedEvent with mountpoint /<userid>/ for all the user ids scanned
    Here is a call stack for all the files:scan event:

  2. Share creation to a user/group does not emit any mount events. The ShareCreatedEvent event is emitted however.
    All the users have at logged in at least once.
    The mount events are emitted when the user logs in or there is a files:scan for that particular user.
    It is the same case with share deletions.

files:scan after share creation:

{"reqId":"pmngY1441revF6CjXJnp","level":3,"time":"2025-02-05T09:58:32+00:00","remoteAddr":"","user":false,"app":"context_chat","method":"","url":"--","message":"UserMountAddedEvent","userAgent":"--","version":"32.0.0.0","data":{"app":"context_chat","mountPoint":"/eve/"}}
{"reqId":"pmngY1441revF6CjXJnp","level":3,"time":"2025-02-05T09:58:32+00:00","remoteAddr":"","user":false,"app":"context_chat","method":"","url":"--","message":"UserMountAddedEvent","userAgent":"--","version":"32.0.0.0","data":{"app":"context_chat","mountPoint":"/eve/files/Flusspferd.pdf/"}}

subsequent files:scan's

{"reqId":"cGhw83SLMlaMVRYoz5Ud","level":3,"time":"2025-02-05T09:59:12+00:00","remoteAddr":"","user":false,"app":"context_chat","method":"","url":"--","message":"UserMountAddedEvent","userAgent":"--","version":"32.0.0.0","data":{"app":"context_chat","mountPoint":"/eve/"}}
  1. For groupfolders, user "admin" already had access to the groupfolder gf1. When group "alpha" is granted access to the same groupfolder, UserMountAddedEvent is emitted for only the user "admin":
{"reqId":"mrFnNx8E1hlmpUmsAxht","level":3,"time":"2025-02-05T10:00:38+00:00","remoteAddr":"192.168.21.6","user":"admin","app":"context_chat","method":"POST","url":"/index.php/apps/groupfolders/folders/1/groups","message":"UserMountAddedEvent","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36","version":"32.0.0.0","data":{"app":"context_chat","mountPoint":"/admin/"}}

Removal of group "alpha" has the same result, UserMountAddedEvent is emitted for user "admin".
No files:scan was done here at any time.

Allowing the group "delta" access to the groupfolder and doing a files:scan then emits the UserMountAddedEvent events for all the users of the group "delta", in addition to all users' root mounts, as said before.

  1. Testing with Teams (circles), similar to groupfolders and normal shares, no event is emitted when a share is created.
    No normal share event is received either.
    Also similar to groupfolders, the Added and Removed events show up on files:scan.

  2. Exactly similar observations with external storage

Let me know if you need more logs for any particular series of steps.

@provokateurin provokateurin force-pushed the feat/mountmanager/emit-events branch from d8c889d to 6818aa9 Compare May 19, 2025 11:56
@provokateurin provokateurin marked this pull request as ready for review May 19, 2025 12:27
@provokateurin provokateurin requested a review from a team as a code owner May 19, 2025 12:27
@provokateurin provokateurin requested review from ArtificialOwl and artonge and removed request for a team May 19, 2025 12:27
@provokateurin provokateurin merged commit 06ce2cc into master May 19, 2025
198 of 200 checks passed
@provokateurin provokateurin deleted the feat/mountmanager/emit-events branch May 19, 2025 15:47
@provokateurin provokateurin removed the pending documentation This pull request needs an associated documentation update label May 20, 2025
@provokateurin
Copy link
Member Author

/backport to stable31

@provokateurin
Copy link
Member Author

/backport to stable30

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

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

File Access Change Propagation

7 participants