buddy_list: Fetch *all* subscribers for small channels in big orgs.
Some checks failed
Code scanning / CodeQL (push) Has been cancelled
Zulip production suite / Ubuntu 22.04 production build (push) Has been cancelled
Zulip CI / ${{ matrix.name }} (zulip/ci:bookworm, true, false, Debian 12 (Python 3.11, backend + documentation), bookworm) (push) Has been cancelled
Zulip CI / ${{ matrix.name }} (zulip/ci:jammy, false, true, Ubuntu 22.04 (Python 3.10, backend + frontend), jammy) (push) Has been cancelled
Zulip CI / ${{ matrix.name }} (zulip/ci:noble, false, false, Ubuntu 24.04 (Python 3.12, backend), noble) (push) Has been cancelled
Zulip production suite / ${{ matrix.name }} (zulip/ci:bookworm, --test-custom-db, Debian 12 production install with custom db name and user, bookworm) (push) Has been cancelled
Zulip production suite / ${{ matrix.name }} (zulip/ci:jammy, , Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga, jammy) (push) Has been cancelled
Zulip production suite / ${{ matrix.name }} (zulip/ci:noble, , Ubuntu 24.04 production install, noble) (push) Has been cancelled
Zulip production suite / ${{ matrix.name }} (zulip/ci:bookworm-7.0, 7.0 Version Upgrade, bookworm) (push) Has been cancelled
Zulip production suite / ${{ matrix.name }} (zulip/ci:bookworm-8.0, 8.0 Version Upgrade, bookworm) (push) Has been cancelled
Zulip production suite / ${{ matrix.name }} (zulip/ci:jammy-6.0, 6.0 Version Upgrade, jammy) (push) Has been cancelled
Zulip production suite / ${{ matrix.name }} (zulip/ci:noble-9.0, 9.0 Version Upgrade, noble) (push) Has been cancelled

Followup to #31645. I tweaked the filter in `maybe_shrink_list`, but
that function works with user ids originally fetched in
`get_filtered_user_id_list`, which was only fetching ids of users
that had been recently active.
This commit is contained in:
evykassirer 2024-09-21 14:55:49 -07:00 committed by Tim Abbott
parent f12ffadfbc
commit 9b8df679d7

View File

@ -382,6 +382,17 @@ function get_filtered_user_id_list(user_filter_text: string): number[] {
const base_user_id_set = new Set([...base_user_id_list, ...pm_ids_set]);
base_user_id_list = [...base_user_id_set];
}
// We want to show subscribers even if they're inactive, if there are few
// enough subscribers in the channel.
const stream_id = narrow_state.stream_id();
if (stream_id) {
const subscribers = peer_data.get_subscribers(stream_id);
if (subscribers.length <= max_channel_size_to_show_all_subscribers) {
const base_user_id_set = new Set([...base_user_id_list, ...subscribers]);
base_user_id_list = [...base_user_id_set];
}
}
}
const user_ids = filter_user_ids(user_filter_text, base_user_id_list);