Skip to content

refactor: flatten nesting in CurrentUser::getCloudId() with early return#2567

Open
miaulalala wants to merge 1 commit intomasterfrom
refactor/get-cloud-id-early-return
Open

refactor: flatten nesting in CurrentUser::getCloudId() with early return#2567
miaulalala wants to merge 1 commit intomasterfrom
refactor/get-cloud-id-early-return

Conversation

@miaulalala
Copy link
Copy Markdown
Collaborator

Summary

Inverts the $cloudId !== false cache guard in CurrentUser::getCloudId() into an early return, removing one level of nesting from the fetch path.

Adds three tests that were missing: cache hit (no session call), session-user path, and token-fallback path.

Test plan

  • New testGetCloudId* tests (3 tests) — green
  • Full CurrentUserTest suite — green

🤖 Generated with Claude Code

Invert the cached-value guard from wrapping the entire body to an early
return, removing one level of nesting. Adds three tests covering the
cache hit, session-user, and token-fallback paths.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cypress
Copy link
Copy Markdown

cypress Bot commented May 6, 2026

Activity    Run #3704

Run Properties:  status check passed Passed #3704  •  git commit 56141b99bf: refactor: flatten nesting in CurrentUser::getCloudId() with early return
Project Activity
Branch Review refactor/get-cloud-id-early-return
Run status status check passed Passed #3704
Run duration 01m 56s
Commit git commit 56141b99bf: refactor: flatten nesting in CurrentUser::getCloudId() with early return
Committer Anna
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