Skip to content

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

Open
DerDreschner wants to merge 1 commit into
masterfrom
fix/always-pass-user
Open

DerDreschner wants to merge 1 commit into
masterfrom
fix/always-pass-user

Conversation

@DerDreschner

Copy link
Copy Markdown

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
Author

/backport to stable35

@DerDreschner

Copy link
Copy Markdown
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/鈥媢nit/鈥媗ib/鈥婱ountManager/鈥婥ircleMountProviderTest.php Tests recipient propagation and external storage creation.
lib/鈥婱ountManager/鈥婥ircleMountProvider.php Supplies the user through both mount-loading paths.
lib/鈥婱odel/鈥婱ount.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"

This branch has not been deployed

No deployments
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.

3 participants