nextcloud / nextcloud/calendar

Room suggestions are silently capped at 3 and not sorted

Open
#8,949 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.2k
Forks
332
Avg merge
16h 13m
Merged PRs (30d)
137

Description

Summary

The room suggestions list is capped at three entries, unsorted. On an instance with more than three bookable rooms, most rooms can never appear as a suggestion even when they are free — and which three you get is effectively the database order.

For administrators this surfaces as "some rooms show under Show rooms but never under Suggested", with no indication that a cap exists.

Steps to reproduce
  1. Configure five or more bookable rooms, all available at the same time.
  2. Create an event and add attendees.
  3. Open the room suggestions.
Expected behaviour

Some indication that the list is truncated, and ideally a deterministic order — the best fitting rooms first.

Actual behaviour

Exactly three rooms, always. The other available rooms are absent with no hint that more exist.

Because nothing is sorted, the three shown are whichever rows the search returned first. Deleting and recreating a room changes its row order, so an admin sees one room appear and another disappear — which reads as a bug in the room backend rather than as a display cap.

Cause

https://github.com/nextcloud/calendar/blob/main/src/components/Editor/Resources/ResourceList.vue#L340-L341

// Take the first three available options
this.suggestedRooms = results.filter((room) => room.isAvailable).slice(0, 3)

results is unsorted — it is the order the principal search returned. The cap has been in place since 12b7963f0 ("Show room suggestions for events", Nov 2021) and is present in 6.5.4, 6.6.0-rc.2 and main.

Suggested fix

Three separate things, roughly in order of value:

  1. Sort before slicing. Smallest room that still fits first is the useful default for a suggestion; right now a 100-seat hall can outrank a 4-seat room purely by row order.
  2. Say that the list is capped — "3 of 12 available rooms", or a "show more" affordance. Silent truncation is what makes this look like a backend fault.
  3. Consider raising or configuring the limit. Three is reasonable for a handful of rooms and restrictive for an office with twenty.
Related

The effect is compounded by a server-side bug in the capacity filter this view relies on: the comparison is lexicographic, so rooms seating 10, 12, 16 and 100 are dropped for a 2-attendee meeting while a 4-seat room is kept — https://github.com/nextcloud/server/issues/64413. Together they can leave a large instance with very few suggestions and no explanation.

Versions

Calendar: reproduced on 6.5.4; same code on 6.6.0-rc.2 and main
Nextcloud: 34.0.4

Found while investigating a downstream report against a third-party room backend (RoomVox#43); the behaviour does not depend on which backend supplies the rooms.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/components/Editor/Resources/ResourceList.vue around lines 340-341, where available rooms are filtered and capped. Reproduce the behavior with five or more available rooms, then inspect how suggested rooms are displayed before choosing the intended ordering and truncation indication. Done means the suggestion list has deterministic behavior and no longer silently hides available rooms without explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.