fix: show federated users in the share dialog when local users also match - #41807
Open
oc-tmueller wants to merge 2 commits into
Open
fix: show federated users in the share dialog when local users also match#41807oc-tmueller wants to merge 2 commits into
oc-tmueller wants to merge 2 commits into
Conversation
…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 <noreply@anthropic.com>
|
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 <noreply@anthropic.com>
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.
Description
The share dialog only appended federated sharees when the search returned no local users and no local groups:
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,Andreaon one instance, localBouwkampandHaverkampon 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, instancecloud.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 asharing.remoteShareesSearchplugin are unaffected.isInstanceDomain()has no remaining callers and is removed.Behaviour change
ShareesTestcase #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 incore/js/sharedialogview.js.Verified locally:
ShareesTest333 tests / 875 assertions green; share dialog karma spec 40/41 (1 pre-existing skip) green.Related
🤖 Generated with Claude Code