Skip to content

[stable33] refactor: flatten nesting with early returns in FilesHooks and ViewInfoCache#2581

Merged
miaulalala merged 2 commits intostable33from
backport/2565/stable33
May 7, 2026
Merged

[stable33] refactor: flatten nesting with early returns in FilesHooks and ViewInfoCache#2581
miaulalala merged 2 commits intostable33from
backport/2565/stable33

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented May 7, 2026

Backport of PR #2565

miaulalala added 2 commits May 7, 2026 12:22
- Data::setOffsetFromSince(): invert guards with early returns and extract
  the repeated fallback fetch into getFirstKnownActivityHeader()
- MailQueueHandler::getAffectedUsers(): early return in the restrictEmails
  branch and extract the duplicated result loop into fetchAffectedUsers()

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…foCache

- FilesHooks::unShare(): invert guard clause to early return; add tests
  covering the guard (non-file/folder nodeType, deleted node) and all
  dispatch branches (TYPE_USER, TYPE_GROUP, TYPE_LINK)
- FilesHooks::unShareSelf(): same guard-inversion treatment
- ViewInfoCache::findInfoById(): replace nested try-catch and $notFound
  flag with sequential try-catch blocks and early returns

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@miaulalala miaulalala enabled auto-merge May 7, 2026 12:22
@miaulalala miaulalala merged commit 86cb6e8 into stable33 May 7, 2026
55 checks passed
@miaulalala miaulalala deleted the backport/2565/stable33 branch May 7, 2026 14:42
@cypress
Copy link
Copy Markdown

cypress Bot commented May 7, 2026

Activity    Run #3725

Run Properties:  status check passed Passed #3725  •  git commit 1f2369b2be: [stable33] refactor: flatten nesting with early returns in FilesHooks and ViewIn...
Project Activity
Branch Review backport/2565/stable33
Run status status check passed Passed #3725
Run duration 04m 02s
Commit git commit 1f2369b2be: [stable33] refactor: flatten nesting with early returns in FilesHooks and ViewIn...
Committer backportbot[bot]
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 1
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 9
View all changes introduced in this branch ↗︎

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.

1 participant