Skip to content

fix: check source and target when emitting copy event#58660

Merged
AndyScherzinger merged 1 commit intomasterfrom
fix/chunked-uploads-on-shared-folders
Mar 2, 2026
Merged

fix: check source and target when emitting copy event#58660
AndyScherzinger merged 1 commit intomasterfrom
fix/chunked-uploads-on-shared-folders

Conversation

@salmart-dev
Copy link
Contributor

@salmart-dev salmart-dev commented Mar 2, 2026

Summary

Fixes an issue when updating files using the ChunkingV2Plugin plugin if the source file and the destination file reside on different storages.

The issue appeared since #52996. After that PR we attempt emitting an FS copy event hook where the source path resolves to null since its absolute path is not in /USER/files but in /USER/uploads. Since the plugin already takes care of emitting the update event, the copy one should probably be skipped.

The bug causes the following exception:

│[ERROR] 2026-03-02T12:08:18+00:00 chz 192..21.2 webdav     
  OC\Files\Node\HookConnector::getNodeForPath(): Argument #1 ($path) must be of type string, null given, 
called in /var/www/html/lib/private/Files/Node/HookConnector.php on line 188            
   TypeError: “OC\Files\Node\│

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
Copy link
Contributor

@come-nc come-nc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your fix makes sense.

The Node API does not support files outside of files/ folder anyway (and that’s what we are moving towards, events are supposed to be replaced by events, using nodes).

It was always a grey area for me when source is in files and not target (or the opposite) what should happen.

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@salmart-dev salmart-dev marked this pull request as ready for review March 2, 2026 13:50
@salmart-dev salmart-dev requested a review from a team as a code owner March 2, 2026 13:50
@salmart-dev salmart-dev requested review from ArtificialOwl, icewind1991, leftybournes and sorbaugh and removed request for a team March 2, 2026 13:50
@salmart-dev salmart-dev self-assigned this Mar 2, 2026
@salmart-dev salmart-dev added 3. to review Waiting for reviews 31-feedback labels Mar 2, 2026
@salmart-dev
Copy link
Contributor Author

/backport to stable33

@salmart-dev
Copy link
Contributor Author

/backport to stable32

@salmart-dev
Copy link
Contributor Author

/backport to stable31

@salmart-dev
Copy link
Contributor Author

/backport to stable30

@AndyScherzinger AndyScherzinger merged commit 0e6c8ec into master Mar 2, 2026
257 of 274 checks passed
@AndyScherzinger AndyScherzinger deleted the fix/chunked-uploads-on-shared-folders branch March 2, 2026 15:50
@backportbot
Copy link

backportbot bot commented Mar 2, 2026

The backport to stable30 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable30
git pull origin stable30

# Create the new backport branch
git checkout -b backport/58660/stable30

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 8431abff

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/58660/stable30

Error: Failed to push branch backport/58660/stable30: remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed for 'https://github.com/nextcloud/server.git/'


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

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.

4 participants