Commit Graph

66476 Commits

Author SHA1 Message Date
Sahil Batra
1713694e3e openapi: Mark server_supported_permission_settings field as stable.
We have mostly decided on the structure of the group permission
setting object in server_supported_permission_settings field of
register response, so this commit removes the comment mentioning
it as unstable and adds the corresponding "Changes" entry.

(cherry picked from commit 6e17b05156)
2025-09-03 17:31:37 -07:00
Sahil Batra
faf08dfcb1 api-docs: Fix incorrect field names for group-setting value objects.
Documentation for group setting values at /api/group-setting-values
incorrectly mentioned obejct fields as 'direct_member_ids' and
'direct_subgroup_ids' when they actually are 'direct_members' and
'direct_subgroups' from the start.

(cherry picked from commit aae639a8a0)
2025-09-03 17:31:37 -07:00
Evy Kassirer
4e3ec18c8a channel_folders: Don't label section OTHER if there are no folders above it.
Fixes #35878.

(cherry picked from commit c52174a0a2)
2025-09-03 17:31:37 -07:00
Mateusz Mandera
2a97f6a88e import: Set Stream.subscriber_count for imported channels.
The import code wasn't setting subscriber_count at all, resulting in a
value of 0 when dealing with imports from 3rd party apps.
We run this unconditionally, also for imports from Zulip, since this
ensures we won't inherit incorrect values, if the data we're import has
them - e.g. due to some bugs that affected the server the data came from.

(cherry picked from commit 6ab30fcced)
2025-09-03 17:31:37 -07:00
Alya Abbott
16f3234f75 help: Clean up intro wording and add a note about subdomain reuse.
(cherry picked from commit b4edfb4a19)
2025-09-03 17:31:37 -07:00
Pratik Chanda
398cf9827b filter: Use encoding for channel/topic narrow for url redirect.
Earlier, when generating redirect url for search exit, we did not
encode the url in case of topic narrows. We expect some characters
to be replaced when generating hash.

This commit encodes the url for channels and topic narrows and
prevents redirecting to broken hashes.

(cherry picked from commit acc5cffae4)
2025-09-03 17:31:37 -07:00
PieterCK
758c541d5a settings_export: Fix plural strings in export confirmation modal.
(cherry picked from commit e9be0c54bd)
2025-09-03 17:31:37 -07:00
Sayam Samal
bf84c2aa19 topic_popover: Update topic URL to permalink for message header popover.
This commit updates the topic URL in the message header topic menu
popover, introduced in feedb6ea2d to a
permalink having a `with` operator attached to it.

(cherry picked from commit a0441b5bcb)
2025-09-03 17:31:37 -07:00
apoorvapendse
9ff265e5f6 composebox: Fix composebox closing on clicking links.
Previously, clicking on links with the composebox open
didn't close it.

7391a2983f introduced a bug
where the composebox focus logic wasn't triggered at all
if drag evidence wasn't present on the target.

We now do a `e.target.closest("a").length > 0` check
like before and only prevent the default click behavior if
dragging on the target link is detected.
This allows normal link clicks to trigger the
previous composebox focus trigger logic.

Fixes: https://chat.zulip.org/#narrow/channel/9-issues/topic/composebox.20closes.20when.20going.20to.20recent.20conversations
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
(cherry picked from commit 7a52313f85)
2025-09-03 17:31:37 -07:00
apoorvapendse
9415de59e9 tests: Make puppeteer tests for drafts more robust.
I noticed that when you are in a group dm narrow
and open drafts, the overlay-message-row class
is inside different containers, and the nth last
child check does not apply for that case, which is
why the test failed.

More generally, last-child is just not a good selector for robust
testing.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
(cherry picked from commit 533f177175)
2025-09-03 17:31:37 -07:00
apoorvapendse
e7796305d2 links: Fix unnecessary blocking of click behavior.
Links become unclickable if the following is true:
1. Composebox is open
2. You have selected some text

Currently doing this will prevent the default click behavior
which is a big bug and can get quite annoying.

We now switch to a more robust check which only prevents the
click behavior if some drag evidence is present, determined with
`mouse_drag.is_drag`

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
(cherry picked from commit 7391a2983f)
2025-09-03 17:31:37 -07:00
Alex Vandiver
9a2194ef6c run-hooks: Handle hooks after OS upgrade on fresh install.
(cherry picked from commit fc962b8b0e)
2025-09-03 17:31:37 -07:00
Karl Stolley
bffaff037e recents: Align filter tops top left, right sidebars.
(cherry picked from commit 2660c876fa)
2025-09-03 17:31:37 -07:00
Karl Stolley
e8cd9b0b4b inbox: Align filters to left, right sidebars.
(cherry picked from commit b71352c4dc)
2025-09-03 17:31:37 -07:00
Karl Stolley
ed8beeabd1 right_sidebar: Eliminate gap between filter, vdots area.
(cherry picked from commit a5ab61f83a)
2025-09-03 17:31:37 -07:00
Karl Stolley
fe90091375 right_sidebar: Establish last-item/next-heading concord.
(cherry picked from commit 545b14abfa)
2025-09-03 17:31:37 -07:00
Karl Stolley
0920e3131f sidebars: Add easily adjustable space below sidebar filters.
(cherry picked from commit 4f08718163)
2025-09-03 17:31:37 -07:00
Karl Stolley
b561f4ee4f sidebars: Bring left, right sidebar tops into concord.
(cherry picked from commit b3fb672b5d)
2025-09-03 17:31:37 -07:00
Karl Stolley
61d0f3736c left_sidebar: Zero out space below Views.
(cherry picked from commit 176ba669c2)
2025-09-03 17:31:37 -07:00
Prakhar Pratyush
e7f3277931 api_docs: Deprecate the non-E2EE register push device endpoints.
Endpoints marked deprecated:
* /users/me/apns_device_token
* /users/me/android_gcm_reg_id

The older endpoints were for non-E2EE push notification case.

Fixes part of #35213.

(cherry picked from commit e8c9f4a811)
2025-08-28 17:34:20 -07:00
Prakhar Pratyush
08336b2f50 api_docs: Mark /mobile_push/test_notification as deprecated.
The older endpoint was for non-E2EE push notification case.

Fixes part of #35213.

(cherry picked from commit b157b14d76)
2025-08-28 17:34:20 -07:00
Kislay Verma
31ac5f8421 api_docs: Clarify description for send_new_subscription_messages.
The same subscription request can contain both existing channels
and newly created channels, so we clarify here that direct message
notifications are only sent when users are subscribed to existing
channels.

Also, updates this text to use "direct message" instead of "DM".

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
(cherry picked from commit 396f4d004a)
2025-08-28 17:34:20 -07:00
Kislay Verma
c068dcf74c test_subs: Add send_new_subscription_messages parameter false test case.
For the sake of completion, we add a test case ensuring that
the response does not contain `new_subscription_messages_sent` if
the parameter `send_new_subscription_messages` is `false`,
as mentioned in the API documentation.

(cherry picked from commit 9b7d6335c1)
2025-08-28 17:34:20 -07:00
Kislay Verma
eae9bb6535 add_subscriptions: Only exclude DMs and not new channel notifications.
When the number of new subscriptions crosses a threshold, we wish to
avoid sending DMs to the user as implemented in #31206. But there was
a bug causing announcement channel and new channel notification
messages to also not be sent.

This commit fixes that bug by ensuring that we only exclude direct
message notications.

(cherry picked from commit 18d9b686b7)
2025-08-28 17:34:20 -07:00
Kislay Verma
d0d54b82a5 test_subs: Add test for all notification bot messages.
In #31206, we changed `add_subscriptions_backend` to exclude the
notification bot DMs when subscribing users to a channel when the
number of subscriptions exceeds MAX_BULK_NEW_SUBSCRIPTION_MESSAGES.

This caused a bug where new channel announcement and creation
notification messages were not being sent. Here we add a test that
confirmes the current behavior, which will be corrected in a
subsequent commit.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
(cherry picked from commit 06d2ecb482)
2025-08-28 17:34:20 -07:00
Lauryn Menard
cf869a29a8 create-channel: Add test for invalid user ID in subscribers param.
(cherry picked from commit e5514d575d)
2025-08-28 17:34:20 -07:00
Lauryn Menard
5ba693446a api-docs: Revise create channel endpoint documentation.
(cherry picked from commit 8ee59e9277)
2025-08-28 17:34:20 -07:00
Lauryn Menard
183abc19be api-docs: Improve rendering of create channel python example.
(cherry picked from commit 910ca975ab)
2025-08-28 17:34:20 -07:00
Lauryn Menard
0a761cfaaa api-docs: Revise folder_id parameter for adding/updating channels.
Revises the description of the `folder_id` parameters in the
api/create-channel, api/subscribe and api/update-stream endpoints.

(cherry picked from commit 224499b58f)
2025-08-28 17:34:20 -07:00
Lauryn Menard
3965bb4d40 create-channel: Remove send_new_subscription_messages parameter.
Removes send_new_subscription_messages parameter from
`POST channel/create` endpoint as Notification Bot DMs
are never sent when users are subscribed as part of
creating a new channel.

Not considered a documentable API change, since the previous parameter
never had any effect, so this is effectively just a documentation and
error-handling bug fix, not an API change relevant to implementors.

(cherry picked from commit 699c0c6200)
2025-08-28 17:34:20 -07:00
Lauryn Menard
53aaef506c create-channel: Clarify flow of new channel and subscription notices.
Updates comments in send_user_subscribed_and_new_channel_notifications
so that it is clearer what notification each "if" block of the function
is generating.

Also, moves variables that are only used in the user subscribed DMs to
that "if" block.

(cherry picked from commit dda2c6e285)
2025-08-28 17:34:20 -07:00
Lauryn Menard
d5016b69ab create-channel: Rename send_messages_for_new_subscribers helper.
Because send_messages_for_new_subscribers also sends channel
notification messages about newly created channels, a clearer
name for is send_user_subscribed_and_new_channel_notifications.

(cherry picked from commit 8b1e536e6b)
2025-08-28 17:34:20 -07:00
Lauryn Menard
4264076e6d api-docs: Revise "description" parameter of new channel folder.
This parameter should be marked as required, but allowing an empty
string value. Updates the description of the parameter to be more
explicit of that fact.

(cherry picked from commit 6847c5bfdb)
2025-08-28 17:34:20 -07:00
Lauryn Menard
008de9883c api-docs: Use a more realistic example for a new channel folder ID.
(cherry picked from commit a497571be6)
2025-08-28 17:34:20 -07:00
Lauryn Menard
dbee13e75c api-docs: Revise descriptive text in channel folders endpoints.
Adds links to relevant help center documentation on channel
folders.

(cherry picked from commit 1d99e55bb4)
2025-08-28 17:34:20 -07:00
Lauryn Menard
28a37f82fa channel-folders: Create two channel folders in the dev database.
Adds a visible example to the PATCH /channel_folders endpoint for
reordering an organization's channel folders. So that the example
works in a normal dev environment, we also add a second channel
folder when populating the dev database.

(cherry picked from commit 4f4923ef2b)
2025-08-28 17:34:20 -07:00
Lauryn Menard
bedc06f6c1 api-docs: Mark "name" required for new channel folder.
Also, note that an empty string for the "name" parameter, when
creating or updating a channel folder, is not a valid value.

(cherry picked from commit 451e64b3e6)
2025-08-28 17:34:20 -07:00
Lauryn Menard
1aad055cd3 api-docs: Mark "order" as required for reodering channel folders.
(cherry picked from commit 4b0a9e484a)
2025-08-28 17:34:20 -07:00
Lauryn Menard
6a318bd2ef api-docs: Add admin only notes for channel folder endpoints.
(cherry picked from commit 4b7e0be1ab)
2025-08-28 17:34:20 -07:00
Prakhar Pratyush
738b3e9399 push_notifications: Log roundtrip time since worker decided to send.
Adds a log for the end-to-end latency from when the worker decided
to send push notifications & received a success response from bouncer.

Fixes part of #35368.

(cherry picked from commit c604ecb902)
2025-08-28 17:34:20 -07:00
Alex Vandiver
62bcab1a1a push_notifications: Revert parallel-device sending.
This reverts #26594, due to unexpected ConnectionClosed errors observed in Django.

(cherry picked from commit 331d210dac)
2025-08-28 17:34:20 -07:00
Mateusz Mandera
d70124be9a retention: Eliminate join with Recipient table when archiving DMs.
We can use the is_channel_message column instead of doing the join to
filter on recipient type.

(cherry picked from commit 4e3ec77a0f)
2025-08-28 17:34:20 -07:00
Mateusz Mandera
ddbe3fa17f delete_in_topic: Don't unnecessarily fetch .recipient.
This reverts commit f119c33789.
With 51cef01c29 merged, there is no need
to fetch .recipient here, as it won't be accessed by the delete messages
codepath.

(cherry picked from commit 5ef6852cfe)
2025-08-28 17:34:20 -07:00
Mateusz Mandera
8c9c39059d message: Use .is_channel_message column instead of is_stream_message().
This avoids a potential unnecessary message.recipient fetch required by
is_stream_message(). is_stream_message() methods precedes the addition
of the denormalized is_channel_message column and is now unnecessary.

In practice, we usually fetch Message objects with `.recipient` already,
so I don't expect any notable performance impact here - but it's still a
useful change to make.

(cherry picked from commit 51cef01c29)
2025-08-28 17:34:20 -07:00
Prakhar Pratyush
51711bd3d9 push_notifications: Parse push/e2ee/notify response using Pydantic.
In `send_push_notifications`, we were manually asserting types of the
fields returned by the `remotes/push/e2ee/notify` endpoint at runtime
and constructed the `response_data` data structure for further use.

Pydantic is the perfect tool for this task.

This commit updates the concerned code to use Pydantic's `TypeAdapter`.

No functional change.

Fixes part of #35368.

(cherry picked from commit 5a37942c61)
2025-08-28 17:34:20 -07:00
Prakhar Pratyush
04352cd738 push_notifications: Use SentPushNotificationResult dataclass.
Refactoring, no functional change.

This commit refactors `send_e2ee_push_notification_apple`
and `send_e2ee_push_notification_android` to return a
`SentPushNotificationResult` dataclass.

It's a cleaner protocol than passing a mutable data structure
`delete_device_ids` as argument and updating it within
functions.

Fixes part of #35368.

(cherry picked from commit 3548764e21)
2025-08-28 17:34:20 -07:00
Prakhar Pratyush
bb534fbab5 api_docs: Document /remotes/push/e2ee/register endpoint.
This commit documents the `/remotes/push/e2ee/register` endpoint.

We use auth_email="ZULIP_ORG_ID" and auth_api_key="ZULIP_ORG_KEY"
instead of "BOT_EMAIL_ADDRESS" and "BOT_API_KEY".

(cherry picked from commit f52533795b)
2025-08-28 17:34:20 -07:00
Prakhar Pratyush
5cd52a2a14 api_docs: Prep work to document zilencer endpoints.
Until now we were not documenting bouncer's REST API endpoints.

We plan to document the newly introduced "remotes/push/e2ee/register"
and "remotes/push/e2ee/notify" endpoints.

This commit does the prep work for documenting bouncer endpoints:
* mark the older endpoints related to sending non-E2EE push
  notifications as "intentionally_undocumented" - we'll remove
  them in future.
* the remaining endpoints are marked pending-to-document with
  helpful comments.

(cherry picked from commit 062a736097)
2025-08-28 17:34:20 -07:00
Prakhar Pratyush
7065f91699 render_curl_example: Remove unused 'auth_email' & 'auth_api_key'.
The 'function' variable in 'APICodeExamplesPreprocessor.generate_text'
matches the pattern of API_ENDPOINT_NAME = r"/[a-z_\-/-{}]+:[a-z]+"

It is always of the form 'endpoint_path:endpoint_method'.

There's no possibility of multiple ':'.

This commit removes the unused code block in `render_curl_example`,
which was trying to get 'auth_email' & 'auth_api_key' from 'function'.

(cherry picked from commit 9785cb4a09)
2025-08-28 17:34:20 -07:00
opmkumar
6a602dc57c hotkey: Enable spectators to copy via keyboard in web-public channels.
Fixes #35782.

(cherry picked from commit ea97d1a77a)
2025-08-28 16:17:08 -07:00