Skip to content

fix(search): let the searching user pick themselves as attendee - #296

Merged
luflow merged 2 commits into
mainfrom
claude/organizer-absence-app-participants-2d231c
Oct 7, 2026
Merged

luflow merged 2 commits into
mainfrom
claude/organizer-absence-app-participants-2d231c

Conversation

@luflow

@luflow luflow commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

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.

  • Root cause: the users/groups/teams picker is built on Nextcloud's sharee search, whose UserPlugin unconditionally removes the searching user (nobody shares with themselves). The organizer picker only hid this by prefilling the current user client-side.
  • Why it hurts since 1.54.0: only the audience may answer an appointment ([BUG] Response handling of Organizers who are not part of limited access group(s) for an event #251). A sole organizer who invites individuals is therefore locked out of responding — the web shows the "not an attendee" hint, mobile builds before 1.9.0 surface the server error.
  • Fix: the search puts the searching user back when the query fits their user ID, display name or email (case-insensitive, substring). An exact hit leads the list like the sharee search's own exact matches, a partial hit closes it, and a user the sharee search already lists is not duplicated.
  • The entry shape moves to ResponseDefinitions as AttendanceDirectoryEntry; the generated specs now carry it as a named DirectoryEntry component (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: DirectorySearchService

The search cluster depended on nothing appointment-related, yet lived in the 2600-line AppointmentService with its tests wired through that class's two dozen mocks. It now has its own service and a focused test class; AppointmentController is the only caller and keeps the permission gate as every sibling action does. The move is behaviour-neutral and sheds carried-over baggage (a dead ISearchResult branch, 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.sh green on both commits (eslint, stylelint, php-cs-fixer, psalm, PHPUnit, vite build, l10n, OpenAPI)
  • Six unit tests in DirectorySearchServiceTest: partial hit on the user ID (appended), exact hit on the display name (leads), hit on the email, no hit, no duplicate, unknown searcher
  • Live in the stable34 dev container as admin: ?search=admin returned only group:admin before and user:admin, group:admin after; ?search=adm appends user:admin

🤖 Generated with Claude Code

luflow added 2 commits October 7, 2026 23:52
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.
@luflow
luflow merged commit 26142e8 into main Oct 7, 2026
6 checks passed
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.

1 participant