Skip to content

Conversation

@artonge
Copy link
Collaborator

@artonge artonge commented Jun 4, 2025

This will catch "Undefined array key" exceptions from above $cachedPath[$userId].

Fix: nextcloud/groupfolders#3680

This will catch "Undefined array key" exceptions from above `$cachedPath[$userId]`.

Fix: nextcloud/groupfolders#3680
Signed-off-by: Louis Chemineau <[email protected]>
@artonge artonge added this to the Nextcloud 32 milestone Jun 4, 2025
@artonge artonge requested review from ArtificialOwl and szaimen June 4, 2025 10:35
@artonge artonge self-assigned this Jun 4, 2025
@artonge
Copy link
Collaborator Author

artonge commented Jun 4, 2025

/backport to stable31

@artonge
Copy link
Collaborator Author

artonge commented Jun 4, 2025

/backport to stable30

@artonge
Copy link
Collaborator Author

artonge commented Jun 4, 2025

/backport to stable29

@cypress
Copy link

cypress bot commented Jun 4, 2025

Activity    Run #2661

Run Properties:  status check passed Passed #2661  •  git commit a2be2c1e19: fix(FilesHooks): Catch all exceptions when looking up unrelated users
Project Activity
Branch Review artonge/fix/fileshook_try_catch
Run status status check passed Passed #2661
Run duration 02m 17s
Commit git commit a2be2c1e19: fix(FilesHooks): Catch all exceptions when looking up unrelated users
Committer Louis
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 10
View all changes introduced in this branch ↗︎

@szaimen
Copy link
Contributor

szaimen commented Jun 4, 2025

/backport! to stable28

@ArtificialOwl
Copy link
Member

should we log something ?

@artonge
Copy link
Collaborator Author

artonge commented Jun 4, 2025

should we log something ?

Not sure, as at that point, we do not know why the user was is not in $cachedPath

Best would have been to add an if (isset($cachedPath[$userId])) above, and to catch-ignore specific exceptions, and to catch-log the others. But not sure what exceptions are supposed to be thrown here.

Considering that I don't know enough to change the code further, and that the initial intention of the code was probably to catch all exceptions, I would stick with the current solution.

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.

Activating the Activity app prevents deleting/moving of files in groupfolders

5 participants