Commit Graph

20353 Commits

Author SHA1 Message Date
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
Alex Vandiver
770d86c288 export-search: Use background workers to download attachments.
(cherry picked from commit d15f2fb831)
2025-08-28 16:17:08 -07:00
Alex Vandiver
6042830850 export-search: Add explicit usermessage message_id range filters.
(cherry picked from commit 7714ca3ff9)
2025-08-28 16:17:08 -07:00
Alex Vandiver
570e32a771 export-search: Use chunked regions by id range.
(cherry picked from commit b9216c768d)
2025-08-28 16:17:08 -07:00
Alex Vandiver
f5097ce7ed export-search: Joins to usermessages may require adding a distinct.
(cherry picked from commit e703f65198)
2025-08-28 16:17:08 -07:00
Alex Vandiver
a9417eb4fe export-search: Limit to only the fields we need.
(cherry picked from commit e9c6856d02)
2025-08-28 16:17:08 -07:00
Alex Vandiver
270a19984a export-search: Prefetch message sender.
This avoids O(n) extra queries.

(cherry picked from commit ae090d9ff3)
2025-08-28 16:17:08 -07:00
Alex Vandiver
9baccbce5e reminders: Stop interpolating user-provided values in format string.
We must not intermix Markdown strings which are ready for the message,
with format strings which we intend to interpolate on.

(cherry picked from commit 575dd10f99)
2025-08-28 16:17:08 -07:00
Tim Abbott
25319590d0 api_docs: Fix missing changes entry for status endpoint.
715d07c231 was missing an API feature
level change.
2025-08-13 16:07:27 -07:00
Tim Abbott
9b2e270a49 zulip_updates: Add an update for the 11.0 release. 2025-08-13 14:48:11 -07:00
Anders Kaseorg
2ddafe728e thumbnail: Avoid BytesIO.getbuffer.
It seems to cause ‘BufferError: Existing exports of data: object
cannot be re-sized’ on Python 3.13.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2025-08-13 14:11:05 -07:00
Anders Kaseorg
f9faad0997 test_timezone: Ignore legacy MET, MEST aliases.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2025-08-13 14:11:05 -07:00
Anders Kaseorg
e216317f88 test_mattermost_importer: Condition html2text crash on Python version.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2025-08-13 14:11:05 -07:00
Tim Abbott
3e84eaab5d onboarding: Improve welcome bot custom message wrapper.
The previous text was rather wordy, and using a silent mention makes
it clear who has the ability to control this group, and who one can
potentially contact with questions.
2025-08-13 14:09:20 -07:00
Alex Vandiver
04fe9be715 upload: Serve 0-byte files locally, not from S3. 2025-08-13 14:07:21 -07:00
Alex Vandiver
7480510aeb embeds: Propagate group membership before updating UserMessage flags. 2025-08-13 10:38:40 -07:00
Prakhar Pratyush
3cbf0e70a2 push_notification: Add support to send E2EE test push notification.
This commit adds an endpoint `/mobile_push/e2ee/test_notification`
to send an end-to-end encrypted test push notification to the user's
selected mobile device or all of their mobile devices.
2025-08-13 00:13:50 -07:00
Prakhar Pratyush
f034a6c3b4 push_notification: Remove is_removal param from send_push_notifications.
We can determine whether the request is meant to revoke an already
sent push notification using the "type" field of the payload.

Passing `is_removal` parameter explicitly to `send_push_notifications`
is not required.
2025-08-13 00:13:50 -07:00
Alya Abbott
a05c76fba3 updates: Edit update announcement (level=20).
Describe additional features; the prior version has not been
deployed to Cloud.
2025-08-12 17:25:42 -07:00
opmkumar
aa9aa2160b help: Clean up search by location documentation. 2025-08-12 15:26:12 -07:00
Vector73
f1d1d5f1a4 events: Add support for sending presence events in modern format.
If the client has passed `simplified_presence_events` as true
in the `client_capabilities` parameter of the `POST /register`
request, then the server will send `presence` events with the
`presences` field, which has the user presence data in the
modern API format. When that client capability is false, the
`presence` event will be unchanged and sent with the user
presence data in the legacy format.
2025-08-12 12:37:54 -07:00
Vector73
88761f70a2 event_schema: Rename "presence" event to "legacy_presence". 2025-08-12 12:14:56 -07:00
Mateusz Mandera
58427f8ed1 external_auth_id: Add new unique constraint. 2025-08-12 12:10:45 -07:00
Sahil Batra
5675860707 channel-folders: Send event when reordering channel folders. 2025-08-12 11:17:17 -07:00
Sahil Batra
bcdfcf909d welcome-bot: Only send message with custom text when testing.
We now only send the custom message when using
"Send me a test message" button and not send the
standard welcome bot message.
2025-08-12 00:12:52 -07:00
apoorvapendse
8f14b717ff zerver: Drop support for Zulip API emails in channel creation.
Also write the description a bit better.

Discussion:
https://chat.zulip.org/#narrow/channel/378-api-design/topic/Channel.20creation.20should.20return.20the.20channel.20ID/near/2240040.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-11 23:40:12 -07:00
Prakhar Pratyush
870591e2e5 test_urls: Skip api_docs/unmerged.d/ while testing api doc pages.
We missed to skip `api_docs/unmerged.d/` in 9ec15e99bd,
resulting in test failure in pull requests where it is present.
2025-08-11 14:37:31 -07:00
Mateusz Mandera
f119c33789 delete_in_topic: Don't fetch .recipient for each message in a loop.
The grouping logic in `do_delete_messages` calls
`message.is_stream_message()` in a loop, which needs to access
message.recipient. This is obviously super inefficient if .recipient
hasn't been prefetched for the message objects.

`delete_in_topic` is the only function that calls `do_delete_messages`
with many messages, so this is the only spot we need to fix, to address
the immediate bug.
Of course a better improvement would be to fix `do_delete_messages` to
do something smarter than naively accessing message.recipient in a loop.
2025-08-11 10:08:40 -07:00
apoorvapendse
6203861529 zerver: API to create channel.
Fixes #16206.

Co-authored-by: Sahil Batra <sahil@zulip.com>
Co-authored-by: Steve Howell <showell@zulip.com>
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 19:29:17 -07:00
Tim Abbott
6ef2591b47 test_invite: Fix a test failing with old databases. 2025-08-08 18:59:37 -07:00
Saubhagya Patel
bb5c87e306 bots: Add a setting to customize the Welcome Bot message.
This commit includes the following changes:
- Add an administrator setting to customize the Welcome Bot
message when sending an invitation.
- Add an API endpoint to test the customized Welcome Bot message
by sending a copy of the message to the administrator.

Fixes #27663.

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>
2025-08-08 18:59:37 -07:00
apoorvapendse
4d49fa6fbb streams: Extract zephyr realm invite check.
This will be reused later in the
`/channels/create` view.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 18:41:47 -07:00
apoorvapendse
1190afbe4f streams: Extract pydantic validation for topics_policy.
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 18:41:47 -07:00
Mateusz Mandera
254b0ff477 scim: Add support for Groups. 2025-08-08 17:29:11 -07:00
Sahil Batra
f7e9f37edc settings: Fix re-ordering folders when there is an archived folder.
This commit updates webapp code to include archived folder IDs as
well in the "order" list passed when re-ordering folders.

Also, updated API documentation to mention that archived folder IDs
should also be included.
2025-08-08 16:29:00 -07:00