refactor: clarify fileCreate() condition by making the specific case explicit#2568
Merged
miaulalala merged 1 commit intomasterfrom May 7, 2026
Merged
refactor: clarify fileCreate() condition by making the specific case explicit#2568miaulalala merged 1 commit intomasterfrom
miaulalala merged 1 commit intomasterfrom
Conversation
…explicit The original condition used a double-negative (De Morgan) form that made the public-upload branch hard to read as the else. Rewrite as a positive check — empty identifier AND public share token — and make the public-upload path the if-branch. Adds the missing fourth test case (non-empty identifier + isPublicShareToken=true → regular upload). Signed-off-by: Anna Larch <anna@nextcloud.com> AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Activity
|
||||||||||||||||||||||||||||
| Project |
Activity
|
| Branch Review |
refactor/file-create-condition
|
| Run status |
|
| Run duration | 02m 17s |
| Commit |
|
| Committer | Anna |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
1
|
|
|
0
|
|
|
9
|
| View all changes introduced in this branch ↗︎ | |
Antreesy
approved these changes
May 7, 2026
Contributor
Antreesy
left a comment
There was a problem hiding this comment.
This I can comprehend 🦭
Collaborator
Author
|
/backport to stable33 |
Collaborator
Author
|
/backport to stable32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The original condition in
FilesHooks::fileCreate()used a double-negative (De Morgan) form:Rewritten as a direct positive check, with the specific case (public upload) as the
if-branch:Also adds the missing fourth test case: a non-empty identifier combined with
isPublicShareToken=true(a logged-in user uploading to a public share link) → treated as a regular upload.No behaviour change.
Test plan
testFileCreatecases (4 data rows × 2 root tests = 6 assertions) — green🤖 Generated with Claude Code