Skip to content

fix(mount-provider): Pass the recipient to the federated share storage - #3060

Merged
DerDreschner merged 1 commit into
masterfrom
fix/always-pass-user
Oct 19, 2026
Merged

DerDreschner merged 1 commit into
masterfrom
fix/always-pass-user

Conversation

@DerDreschner

Copy link
Copy Markdown
Member

Summary

Since Nextcloud 34.0.5 / 35.0.2, the federated share storage requires the user receiving the share as recipient option. Team mounts didn't pass it, so setting up the filesystem of a user with a team share from a remote instance failed with an Undefined array key "recipient" exception. This aborted e.g. occ versions:expire and occ versions:cleanup.

Pass the user the mounts are set up for from getMountsForUser() and getMountsForPath() to the storage.

Checklist

AI (if applicable)

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

Since Nextcloud 34.0.5 / 35.0.2, the federated share storage requires the user receiving the share as `recipient` option. Team mounts didn't pass it, so setting up the filesystem of a user with a team share from a remote instance failed with an `Undefined array key "recipient"` exception. This aborted e.g. `occ versions:expire` and `occ versions:cleanup`.

Pass the user the mounts are set up for from getMountsForUser() and getMountsForPath() to the storage.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
@DerDreschner

Copy link
Copy Markdown
Member Author

/backport to stable35

@DerDreschner

Copy link
Copy Markdown
Member Author

/backport to stable34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

Both mount-loading paths supply the required recipient, with regression coverage and no blocking issues identified; tests were not executed.

0 open findings

What changed in this PR

Fixes remote team mounts by passing the receiving user to federated share storage, preventing missing-recipient failures during filesystem setup.

Changes:

  • Passes the recipient through both mount-loading paths.
  • Includes the recipient in storage options.
  • Adds regression tests for recipient propagation and storage creation.
File Description
tests/​unit/​lib/​MountManager/​CircleMountProviderTest.php Tests recipient propagation and external storage creation.
lib/​MountManager/​CircleMountProvider.php Supplies the user through both mount-loading paths.
lib/​Model/​Mount.php Stores and exposes the recipient in storage options.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cristianscheid cristianscheid left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. I tested this, and seems to work as expected:

  • as alice on nc1, created test_team and added bob from nc2
  • as alice on nc1, shared test_folder with test_team
  • as bob on nc2, I can see and access test_folder from his files

Before this fix, I was running into following exception when accessing file as bob on nc2:

"Cannot assign null to property OCA\\Files_Sharing\\External\\Storage::$recipientUser of type OCP\\IUser in file '/var/www/html/apps/files_sharing/lib/External/Storage.php' line 91"

@DerDreschner
DerDreschner merged commit 805903b into master Oct 19, 2026
51 checks passed
@DerDreschner
DerDreschner deleted the fix/always-pass-user branch October 19, 2026 12:16
@cristianscheid

Copy link
Copy Markdown
Member

@DerDreschner any idea why the backport bot did not open the PRs?

@DerDreschner

Copy link
Copy Markdown
Member Author

@cristianscheid I have no idea. Looks like we should be able to see it through Settings -> Developer Settings -> GitHub Apps, but I have no access to that on this repo. I'll try again.

@DerDreschner

Copy link
Copy Markdown
Member Author

/backport to stable35

@DerDreschner

Copy link
Copy Markdown
Member Author

/backport to stable34

@DerDreschner

Copy link
Copy Markdown
Member Author

/backport to stable33

@DerDreschner

Copy link
Copy Markdown
Member Author

Wheee. I'll fix the drafts tomorrow.

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