Repository navigation
fix(search): let the searching user pick themselves as attendee - #296
Merged
Merged
Conversation
The audience and organizer pickers query Nextcloud's sharee search, which always drops the searching user — nobody shares with themselves. Since 1.54.0 only the audience may answer an appointment, so a sole organizer who invites individuals could no longer add themselves and was locked out of responding: the web shows the "not an attendee" hint, older mobile builds surface the server error. The service now puts the searching user back when the query fits their user ID, display name or email: an exact hit leads the list, a partial hit closes it. The entry shape moves to ResponseDefinitions as AttendanceDirectoryEntry, which turns the inlined search schema into a named component in the generated specs. Two psalm baseline entries go because the typing fixed them.
The users/groups/teams search depended on nothing appointment-related, yet lived in the 2600-line AppointmentService with its tests wired through that class's two dozen mocks. DirectorySearchService now owns it, with AppointmentController as its only caller. The move sheds what the old home had carried along: a dead ISearchResult branch on a method whose interface documents an array, an unused $hasMore, and comments restating the code. The psalm baseline entries that still apply moved with the code; the ones the typing fixed are gone.
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.
Summary
An organizer could not add themselves as an attendee of their own appointment: the audience picker never offered them, neither when creating nor when editing later.
UserPluginunconditionally removes the searching user (nobody shares with themselves). The organizer picker only hid this by prefilling the current user client-side.ResponseDefinitionsasAttendanceDirectoryEntry; the generated specs now carry it as a namedDirectoryEntrycomponent (same shape as before).The mobile app calls the same endpoint, so it gets the fix with the server update — no app change and no capability flag needed, the response only gains one more entry of an existing shape.
Second commit:
DirectorySearchServiceThe search cluster depended on nothing appointment-related, yet lived in the 2600-line
AppointmentServicewith its tests wired through that class's two dozen mocks. It now has its own service and a focused test class;AppointmentControlleris the only caller and keeps the permission gate as every sibling action does. The move is behaviour-neutral and sheds carried-over baggage (a deadISearchResultbranch, an unused$hasMore, comments restating the code). Psalm baseline entries that still apply moved with the code by hand; the ones the typing fixed are gone.Test plan
./scripts/check.shgreen on both commits (eslint, stylelint, php-cs-fixer, psalm, PHPUnit, vite build, l10n, OpenAPI)DirectorySearchServiceTest: partial hit on the user ID (appended), exact hit on the display name (leads), hit on the email, no hit, no duplicate, unknown searcheradmin:?search=adminreturned onlygroup:adminbefore anduser:admin, group:adminafter;?search=admappendsuser:admin🤖 Generated with Claude Code