Skip to content

[stable32] refactor: flatten nesting with early returns in FilesHooks and ViewInfoCache#2582

Draft
backportbot[bot] wants to merge 2 commits intostable32from
backport/2565/stable32
Draft

[stable32] refactor: flatten nesting with early returns in FilesHooks and ViewInfoCache#2582
backportbot[bot] wants to merge 2 commits intostable32from
backport/2565/stable32

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented May 7, 2026

Backport of #2565

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

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

refactor: flatten nesting with early returns in FilesHooks and ViewInfoCache

- 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>

[skip ci]
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