Commit Graph

21 Commits

Author SHA1 Message Date
Kislay Verma
67ca49488f tests: Use make_realm to create type-correct realm objects.
Another step in the direction of improving node tests
and using type-correct organic data as much as possible.
2025-08-28 11:35:07 -07:00
Kislay Verma
c134cc398f tests: Add library function to create user groups.
This is done to ensure the objects exactly match
the schema/types during tests.

Fixes part of #32326.
2025-08-11 11:57:49 -07:00
Evy Kassirer
55634c8fcc peer_data: Use sub.subscriber_count for get_subscriber_count. 2025-07-16 13:11:56 -07:00
Evy Kassirer
5a23287cf5 peer_data: Stop returning unused boolean from remove_subscriber. 2025-07-15 17:38:02 -07:00
Evy Kassirer
0b3328f7b3 peer_data: Ensure potential_subscribers is only called with full data.
Work towards #34244.

We can guarantee this because the add subscriber typeahead (and the
rest of the subscribers tab) is only visible once subscribers have
been loaded.
2025-05-14 15:00:45 -07:00
Evy Kassirer
44b87c72dc stream_edit: Fetch subscribers before showing subscriber tab.
Work towards #34244.

Now that we're supporting partial subscriber data, we might need
to fetch the full list of subscribers when opening the subscribers
tab of the edit channel modal.

This commit handles a slow load with a loading spinner while we fetch
the data, and also makes sure to ignore the data if it's received after
it stops being relevant (in case the user has another stream's data open).
2025-05-14 15:00:45 -07:00
Evy Kassirer
25c0b279f7 invite: Fetch full user set for get_unique_subscriber_count_for_streams.
Work towards #34244.
2025-05-12 15:11:50 -07:00
Evy Kassirer
8fab9a23ce compose_validate: Fetch all subscribers before private channel warning.
Work towards #34244

This is the only call to `peer_data.is_subscriber_subset`, so after
this commit all calls to that function work with our new model for
partial subscriber data.
2025-05-06 10:26:36 -07:00
Evy Kassirer
768f8bc968 compose_validate: Fetch subscribers before unsubscribed user mention warning.
Work towards #34244.
2025-05-06 10:09:36 -07:00
Evy Kassirer
24c469f9c9 peer_data: Add ability to retry failed subscriber fetch. 2025-05-05 09:27:53 -07:00
Evy Kassirer
2be8277a68 peer_data: Return null if fetching subscribers fails. 2025-05-01 17:15:40 -07:00
Evy Kassirer
b0aff0af77 peer_data: Store peer add/remove events that come during fetch requests. 2025-05-01 17:15:40 -07:00
Evy Kassirer
8efe6a7b67 buddy_list: Fetch full subscriber data before showing user counts.
Work towards #34244.

Note that this doesn't show the right counts when the counts appear, because
yet. We can double check functionality after that change is complete.
2025-05-01 17:15:40 -07:00
Evy Kassirer
e2474d8e44 peer_data: Rename get_loaded_subscriber_subset.
We have added an ability to partially load subscribers,
and this function name makes it more clear what it returns,
in contrast to an upcoming `get_full_subscriber_set`.
2025-05-01 17:15:40 -07:00
Sahil Batra
4f80823191 settings: Fix opening settings for guests who cannot access all users.
Opening settings and stream settings UI was not working for guests
if they could not access all users. This was because is_person_active
did not handle inaccessible users correctly, if they were not added in
the users data, when being called in get_group_members to render
group pills.
2025-04-14 11:44:11 -07:00
Evy Kassirer
9dc5d19082 stream_data: Remove undefined check for never undefined user_id. 2025-03-31 09:41:45 -07:00
Sahil Batra
166d9282b8 streams: Use can_subscribe_group setting for checking permission.
This commit adds code to use can_subscribe_group setting in webapp.

Fixes part of #33417.
2025-02-25 13:17:15 -08:00
Shubham Padia
89ea21f7f0 stream_data: Use user_has_permission_for_group_setting.
Before this, we were using `is_user_in_setting_group` which does not do
the extra checks around a guest user's permissions (and in future, some
other checks).
We introduced `initialize_and_override_current_user` in stream_data test
to make it easier to set current_user.user_id.
2025-02-18 12:49:05 -08:00
Shubham Padia
b786e70b89 stream_data: Add content/metadata access argument to change permission.
We are making this change with default set as true, since that is the
behaviour other functions are expecting. We are not making any behaviour
changes in this commit on where metadata access should be check or where
content access should be checked for this function's usage. That will be
done commit by commit for different functions using
`can_change_permissions`.
Accepting `require_content_access` makes it a bit hard to read at other
places where the argument is passed as just true or false without
knowing what the argument is for, but it was just a choice when writing
the code. We will refactor this current function into two functions in
the upcoming commits and solve that problem.
We've also removed `can_edit_description` from `stream_data` but we have
kept around `can_change_name_description` in `stream_settings_data`.
Since `can_edit_description` was just used at once place, it didn't make
much sense to keep it around, but we kep around
`can_change_name_description` since we've already done the work to have
fine tuned permissions for that setting and we don't want to undo that
work.
2025-02-11 15:09:16 -08:00
Anders Kaseorg
b19a556982 stream_types: Remove email_address from ApiStreamSubscription.
Commit 432001656e removed this from the
backend.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-30 09:42:26 -08:00
Anders Kaseorg
687f1b1651 tests: Rename the Node tests to *.cjs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00