Earlier, unread_count in home view tooltip was set to total unread
messages while we normally exclude muted messages from unread_count.
This commit changes this by setting it to `home_unread_messages`.
In order to avoid races with the user's device connecting to a
network after unsuspending, we ping the server settings endpoint
for a success response before initiating the reload of the app.
Fixes#33118.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
Extracts message_fetch and get_events algorithms for calculating the
exponential backoff into a shared helper function.
These match the algorithm that were designed for the Python API, except
that we use a ratio of 2 rather than sqrt(2) in the message_fetch code
path.
Updates the selector for the channel narrow and combined feed
in this puppeteer test to be more specific than the message feed
container, which is what the check for the direct message view
already does in this test.
A disabled pill cannot be removed. It will not have the `x` sign inside
it's pill. Pressing backspace on the pill will not remove it. But it
will still be possible to shift focus on the disabled pill using the
backspace button.
We decided to keep disabled not as a property of `item` and instead of
the pill via `InputPill`. This means that a pill is disabled and not an
item. Also, since the item types vary so much between user, user group,
channel and other pills, adding disabled to `InputPill<ItemType>` makes
it much more simpler to add this capability to wherever needed one by
one.
We also need to pass this property to `generate_pill_html` so the
respective functions can respect that property and render the pill
accordingly.
While this feature is not in use at the immediate moment, we've kept it
around since it is likely to be useful in the future.
Resolved a transition issue in the polls UI when switching between dark and light modes. This fixes visual inconsistencies and ensures smoother transitions, improving the overall user experience.
Fixes#30628.
Previously, Cmd + Return did not send messages in preview mode when
configured by the user.
This commit fixes the logic to allow sending messages in preview
mode with Cmd + Return as per user configuration.
Fixes: #32960.
This is helpful for info density, because `em` values change
depending on the font-size of the HTML element, and we want to
be able to reference `em` sizes for the placement of the message
header container when it's sticky.
This commit should have no functional changes because
`message-header-contents` is the only child of `message_header`
and doesn't itself use font size or line height.
This commit also changes the line height to unitless
https://chat.zulip.org/#narrow/channel/6-frontend/topic/navbar.20sticky.20header.20with.20em/near/2054561
This commit adds hardening such that if the invariant "no usermessage
row corresponding to a message exists if the user loses access to the
message" is violated due to some bug, user can't access the attachment
if they are not subscribed.
This commit updates the 'get_mentions_for_message_updates' function to
use the generic 'event_recipient_ids_for_action_on_messages' function
to determine users having access to the message and perform an
intersection with the mentioned users to filter out the users who
no longer can access the message.
It helps to add hardening such that if the invariant "no usermessage
row corresponding to a message exists if the user loses access to the
message" is violated due to some bug, it has minimal user impact.
This commit updates the 'do_update_embedded_data' function to use
the generic 'event_recipient_ids_for_action_on_messages' function
while deciding the event's recipients.
It helps to add hardening such that if the invariant "no usermessage
row corresponding to a message exists if the user loses access to the
message" is violated due to some bug, it has minimal user impact.
Users most likely to run into this will be the ones who are moving to a
new server, but keeping their original domain and thus just need to
transfer the registration.
If the server controls the registration's hostname, it can reclaim its
registration credentials. This is useful, because self-hosted admins
frequently lose the credentials when moving their Zulip server to a
different machine / deployment method.
The flow is the following:
1. The host sends a POST request to
/api/v1/remotes/server/register/takeover.
2. The bouncer responds with a signed token.
3. The host prepares to serve this token at /api/v1/zulip-services/verify and
sends a POST to /remotes/server/register/verify_challenge endpoint of
the bouncer.
4. Upon receiving the POST request, the bouncer GETS
https://{hostname}/api/v1/zulip-services/verify, verifies the secret and
responds to the original POST with the registration credentials.
5. The host can now save these credentials to it zulip-secrets.conf file
and thus regains its push notifications registration.
Includes a global rate limit on the usage of the /verify_challenge
endpoint, as it causes us to make outgoing requests.
Fixes: #32934
context:
Fetching all users who are members (directly or via sub-groups)
of groups mentioned in one message.
Reduce O(n) queries, where n is the number
of mentioned groups, to a constant of 1 query.
Extend "get_recursive_subgroups_for_groups" functionality to
"get_root_id_annotated_recursive_subgroups_for_groups"
which is the same but keeps track of each group root_id and
annotates it to each group.
Then in init_user_group_data(), we only fetch
each group's root_id along with
active direct members.
- Function now returns early if can_edit_settings is false since
we do not want details if the group has direct permission or not.
- Added function to get the tooltip text if group has permission
due to being subgroup of a group that has permission.
- Added comments for some explaination around different blocks.
This commit renames group_setting_labels to all_group_setting_labels
since it contains labels for all realm, stream and group level group
permission settings and we use group_setting_labels variable to pass
labels for one type of settings to templates.
This commit renames GroupSettingName type to GroupGroupSettingName
making it consistent with similar RealmGroupSettingName and
StreamGroupSettingName types.
Also, renamed group_setting_name_schema similarly.
There was a bug when updating email notification batching period
setting to a custom value not present in dropdown because
"email_notifications_batching_period_minutes" is just a name
used for input elements and we do not use it to store the setting
value as it is just stored in seconds.
If this is called on a user without is_mirror_dummy=True, that seems
certain to be a bug. Therefore, an assert is preferable in order to
catch this, rather than returning early with noop like some other
function such as do_deactivate_user.