Skip to content

fix: show federated users in the share dialog when local users also match - #41807

Merged
oc-tmueller merged 2 commits into
masterfrom
fix/se-1943-federated-sharees-hidden
Sep 7, 2026
Merged

oc-tmueller merged 2 commits into
masterfrom
fix/se-1943-federated-sharees-hidden

Conversation

@oc-tmueller

Copy link
Copy Markdown
Contributor

Description

The share dialog only appended federated sharees when the search returned no local users and no local groups:

var suggestions = users.concat(groups);
if (suggestions.length < 1 && !isBatch) {
	suggestions = suggestions.concat(remotes);
}

A single local match - including a partial one - therefore hid every federated result, exact federated cloud id matches included. If a federated user's name shares a stem with any local account (e.g. federated Kamp,Andrea on one instance, local Bouwkamp and Haverkamp on the other), the federated user becomes unreachable from the share dialog unless the full cloud id is typed.

Root cause

That frontend filter was introduced in #38389 to hide a suggestion the server generates: ShareesController::getRemote() offers the raw search term as a federated cloud id whenever it merely contains an @, so typing the email address of an existing local account produced a bogus federated suggestion next to the real one.

The backend already tried to guard against this, but only dropped the guess when the address' domain part was listed in trusted_domains. For a typical deployment (mail @company.com, instance cloud.company.com) that never matches, which is why the far broader frontend filter was reached for.

Fix

Suppress the speculative entry at its source: getRemote() now skips it whenever the search term already matched a local user or group exactly - the local account wins. With the noise gone, the share dialog can append federated results unconditionally again.

Note this only affects the generated guess (the sole remote entry that carries no value.server); federated contacts found in the address book and remotes returned by a sharing.remoteShareesSearch plugin are unaffected.

isInstanceDomain() has no remaining callers and is removed.

Behaviour change

ShareesTest case #15 is inverted deliberately: an exact local user now wins even when the email domain is not a trusted domain.

Tests

  • apps/files_sharing/tests/API/ShareesTest.php: case use post to delete files, get has a limit and fails with many files #15 updated; new cases for an exact local group suppressing the guess, and for an address-book federated contact surviving alongside an exact local user.
  • core/js/tests/specs/sharedialogviewSpec.js: two specs covering a federated sharee alongside partially matching local users, and an exact federated match alongside a matching local group. Both fail without the change in core/js/sharedialogview.js.

Verified locally: ShareesTest 333 tests / 875 assertions green; share dialog karma spec 40/41 (1 pre-existing skip) green.

Related

🤖 Generated with Claude Code

…atch

The share dialog only appended federated sharees when the search returned
no local users and no local groups, so a single local match hid every
federated result - including exact federated cloud id matches. Searching
for a name stem shared by local accounts therefore made federated users
unreachable unless the full cloud id was typed.

That filtering existed to hide a suggestion generated by the server: a
search term containing an "@" was always offered as a federated cloud id,
even when it was the email address of an existing local account. Suppress
that guess at its source instead - it is now skipped whenever the search
matched a local user or group exactly - and let the share dialog show all
federated results again.

The previous backend guard only dropped the guess when the domain part was
one of the instance's trusted_domains, which is rarely the case for user
email addresses, so isInstanceDomain() is no longer needed.

Co-Authored-By: Claude Opus 5 <[email protected]>
@oc-tmueller
oc-tmueller requested a review from a team as a code owner September 4, 2026 14:21
@update-docs

update-docs Bot commented Sep 4, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Co-Authored-By: Claude Opus 5 <[email protected]>
@oc-tmueller
oc-tmueller merged commit 4d22521 into master Sep 7, 2026
30 checks passed
@oc-tmueller
oc-tmueller deleted the fix/se-1943-federated-sharees-hidden branch September 7, 2026 09:17
oc-tmueller added a commit that referenced this pull request Sep 25, 2026
Bump version.php to 11.0.1 and materialize the changelog fragments for
the first patch release of the 11.0 line.

$OC_Version becomes [11, 0, 1, 0]: the 4th digit is the internal
DB-upgrade patch level, not the public patch number, and nothing in this
release needs it moved.

The 15 fragments in changelog/unreleased/ move into
changelog/11.0.1_2026-09-25/ (git mv, so the renames stay tracked) and
CHANGELOG.md is regenerated with calens. unreleased/ keeps its .gitkeep
and is now empty, ready for the next cycle.

Security:

- #41827 reject SVG/script content before it reaches ImageMagick bitmap
  previews
- #41834 pin the Imagick coder for each preview provider
- #41856 prevent path traversal via appconfig public_/remote_ keys

Bugfixes:

- #41676 reduce priority of checkPropFind event
- #41779 do not echo secrets when setting config values via occ
- #41782 restore index usage for filecache writes on Oracle
- #41807 show federated users in the share dialog when local users also
  match
- #41808 avoid a deprecation notice when hashing the file cache path on
  Oracle
- #41824 ship only the app payload in the release tarballs
- #41835 release the file handle when a bitmap preview cannot be decoded
- #41855 show a media type icon when a preview file cannot be opened
- #41869 restrict federated address book sync to the trusted server

Changes:

- #41775 update PHP dependencies
- #41785 require rhukster/dom-sanitizer as a tagged release
- #41808 restore Oracle database support in the command line installer

The #41824 fragment is carried over from #41825, which prepared this
release on a release/v11.0.1 branch that the org maintenance ruleset
freezes after its first push; that branch cannot take the changelog
commit, so this supersedes it.

Once merged, v11.0.1 gets tagged on the merged commit and the release
bundles are built and published from owncloud/server-release.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>
oc-tmueller added a commit that referenced this pull request Sep 25, 2026
* feat: release 11.0.1

Bump version.php to 11.0.1 and materialize the changelog fragments for
the first patch release of the 11.0 line.

$OC_Version becomes [11, 0, 1, 0]: the 4th digit is the internal
DB-upgrade patch level, not the public patch number, and nothing in this
release needs it moved.

The 15 fragments in changelog/unreleased/ move into
changelog/11.0.1_2026-09-25/ (git mv, so the renames stay tracked) and
CHANGELOG.md is regenerated with calens. unreleased/ keeps its .gitkeep
and is now empty, ready for the next cycle.

Security:

- #41827 reject SVG/script content before it reaches ImageMagick bitmap
  previews
- #41834 pin the Imagick coder for each preview provider
- #41856 prevent path traversal via appconfig public_/remote_ keys

Bugfixes:

- #41676 reduce priority of checkPropFind event
- #41779 do not echo secrets when setting config values via occ
- #41782 restore index usage for filecache writes on Oracle
- #41807 show federated users in the share dialog when local users also
  match
- #41808 avoid a deprecation notice when hashing the file cache path on
  Oracle
- #41824 ship only the app payload in the release tarballs
- #41835 release the file handle when a bitmap preview cannot be decoded
- #41855 show a media type icon when a preview file cannot be opened
- #41869 restrict federated address book sync to the trusted server

Changes:

- #41775 update PHP dependencies
- #41785 require rhukster/dom-sanitizer as a tagged release
- #41808 restore Oracle database support in the command line installer

The #41824 fragment is carried over from #41825, which prepared this
release on a release/v11.0.1 branch that the org maintenance ruleset
freezes after its first push; that branch cannot take the changelog
commit, so this supersedes it.

Once merged, v11.0.1 gets tagged on the merged commit and the release
bundles are built and published from owncloud/server-release.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>

* fix: name every updated PHP dependency in the 11.0.1 changelog

composer/semver (3.4.4 to 3.5.0) and nikic/php-parser (v5.8.0 to v5.9.0)
both moved since v11.0.0, both are direct entries in composer.json's
require, and neither was named in the fragment. Diffing composer.lock at
v11.0.0 against this branch gives 26 changed production packages; the
fragment listed 24.

Each was missed by the pass that bumped it: #41864 edited this fragment in
the same commit that raised composer/semver, and #41829 did the same for
nikic/php-parser. The list is not direct-only either — it already names
transitive dependencies such as guzzlehttp/psr7 and symfony/mime — so both
are omissions, not a scoping decision. An administrator reconciling the
11.0.1 notes against advisory ranges would read both as unchanged.

The four remaining differences are require-dev only (myclabs/deep-copy,
phpunit/phpunit, sebastian/exporter, sebastian/recursion-context) and stay
out, matching the fragment's existing production-only scope; the tarball
installs --no-dev.

Also restores CHANGELOG.md's trailing newline. `ocrelease changelog` writes
calens' stdout as captured by execa, which strips it; the last six
"chore: update changelog" revisions of the file all end in one, and so does
calens' own output, so the next regeneration would have put it back as a
one-line no-op diff.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Thomas Müller <[email protected]>

---------

Signed-off-by: Thomas Müller <[email protected]>
Co-authored-by: Thomas Müller <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants