Commit Graph

65408 Commits

Author SHA1 Message Date
Prakhar Pratyush
f94d3bd4a2 stream_topic_history: Use first_including_muted for the oldest message.
Earlier, we were using `all_messages_data.first()` for the oldest
message ID we have in cache, which is incorrect.

`all_messages_data.first_including_muted()` returns the oldest ID.

This commit fixes the bug.
2025-06-19 12:43:02 -07:00
Prakhar Pratyush
9bd55fcb8c get_server_history: Support multiple callbacks while request is pending.
Previously, if `get_server_history()` was called while a request
for the stream was already pending, the provided `on_success`
callback was ignored.

This commit fixes that by queuing all `on_success` callbacks per
stream_id when a request is already in flight. Once the request
completes, all queued callbacks are executed.
2025-06-19 12:43:02 -07:00
Tim Abbott
f5d0a3ee30 test_subs: Fix incorrect removed import.
Another use got added before the commit removing the import was merged.
2025-06-19 10:55:36 -07:00
Kislay Verma
2f696c5ec3 tests: Add library function to create message lists.
This function actually instantiates the
`MessageList` and `MessageListData` classes instead
of just mocking its structure as it is currently done.

It addresses https://github.com/zulip/zulip/pull/34645#discussion_r2099058418
2025-06-19 10:50:21 -07:00
Kislay Verma
5174dafb37 drafts: Use library functions in test.
In this commit we use functions from `example_stream`
and `example_user` modules in our test library.

Fixes part of 32326
2025-06-19 10:50:21 -07:00
Sahil Batra
b655bd14ea messages: Use "\x07" as topic for DMs and group DMs.
This commit updates code to use "\x07" as value for
"subject" field of Message objects for DMs and group
DMs, so that we have a unique value for DMs and group
DMs which cannot be used for channel messages.

This helps in avoiding having an empty string value as
topic for DMs, which is also used for "general chat"
channel messages, as large number of DMs in the realm
resulted in PostgreSQL query planner thinking that there
are too many "general chat" messages and thus generated
bad query plans for operations like fetching
"general chat" messages in a stream or moving messages
to and from "general chat" topic.

This change as done for ArchivedMessage and
ScheduledMessage objects as well.

Note that the clients still get "subject" value as
an empty string "".

This commit also adds tests for checking that "\x07"
cannot be used as topic for channel messages.

Fixes #34360.
2025-06-19 10:44:37 -07:00
Sahil Batra
5a45779634 test_message_dict: Add test for checking "subject" field value. 2025-06-19 10:44:37 -07:00
Sahil Batra
bdcdbc5565 tests: Add test to check edit history of a DM. 2025-06-19 10:44:37 -07:00
Sahil Batra
e06c181a95 tests: Move test to check permission to deactivate streams.
This commit moves test to check permission to deactivate
streams to test_channel_permissions.py.
2025-06-19 10:42:52 -07:00
Sahil Batra
3f8518f9d1 tests: Move channel administering permission tests.
This commit moves tests to check permission for administering
streams as per can_administer_channel_group setting to
test_channel_permissions.py.
2025-06-19 10:42:52 -07:00
bedo
7eadabe10a move_topic_modal: Only include messages senders in warning banner.
Only participants who sent the messages being moved
should appear in the warning banner.
2025-06-19 10:30:08 -07:00
bedo
26efeef3ee move_topic_modal: Fix "n_unsubscribed_participants" name.
Rename "n_unsubscribed_participants" to "unsubscribed_participants_count",
the former is the wrong template variable name.
2025-06-19 10:30:08 -07:00
Mateusz Mandera
0d17f34ff5 slack_import: Import Slackbot as a bot instead of a user.
Slackbot should be correctly marked as a bot rather than a regular user
- otherwise, it confusingly appears on the Users list and in the realm
creation from Slack import flow, in the dropdown for choosing the
organization owner account.

Closes #34649
2025-06-18 16:55:31 -07:00
Mateusz Mandera
75da563776 slack_import: Fix bug when need_select_realm_owner is not set.
When selecting the realm owner is not needed in the realm creation from
Slack flow, we don't set need_select_realm_owner value on the
preregistration_realm object. Thus, this codepath cannot expect to
always find the key - and instead should use .get(), defaulting to False.
2025-06-18 16:55:31 -07:00
Lauryn Menard
bbd0f6e11c support: Revise view for scrubbed realms.
When a realm is scrubbed, there should be no support actions to
take and all user information has been removed.
2025-06-18 16:51:25 -07:00
Lauryn Menard
79ea4b6eb0 support: Revise management forms for deactivated realms.
The only form we want to show in the "Realm management" section of
the support view for deactivate realms is the one to reactivate it.
2025-06-18 16:51:25 -07:00
Lauryn Menard
f9dd3aada3 support: Show sponsorship forms only for non-deactivated realms.
For deactivated realms, we show their sponsorship state (discount,
required plan tier, etc.) but not the form to update those fields.
2025-06-18 16:51:25 -07:00
Lauryn Menard
405dc6131f support: Show scrub realm button only when realm is deactivated. 2025-06-18 16:51:25 -07:00
Lauryn Menard
696bdf0b17 support: Update view for placeholder realms.
When a realm is a placeholder realm due, i.e., the realm redirects
to another URL due to previously changing the realm's subdomain,
we only show the redirect information.

There is a copy link that for the redirect URL that can be pasted
into the search bar to get to the support view for the actual
realm.
2025-06-18 16:51:25 -07:00
Lauryn Menard
a29dd27c4a support: Add label when a realm is deactivated. 2025-06-18 16:51:25 -07:00
Lauryn Menard
466ef9d682 support: Improve format of confirmation realm section.
For confirmation objects that do not show realm details, but have
a realm object, format the header information to match what we do
show in the realm details page and show the realm's subdomain.
2025-06-18 16:51:25 -07:00
Lauryn Menard
7f0697eccb support: Set realm correctly for realm reactivation confirmations. 2025-06-18 16:51:25 -07:00
Tim Abbott
f0331b8c50 api: Increment API feature level to 393. 2025-06-18 16:48:26 -07:00
Shubham Padia
00fe2236da message_delete: Sort message_ids when sending delete_message event.
Fixes #34324.
https://chat.zulip.org/#narrow/channel/412-api-documentation/topic/Make.20message_ids.20from.20message.20update.20event.20sorted
2025-06-18 16:48:21 -07:00
Shubham Padia
37bfb7c963 message_edit: Sort message_ids when sending update_message event.
https://chat.zulip.org/#narrow/channel/412-api-documentation/topic/Make.20message_ids.20from.20message.20update.20event.20sorted
2025-06-18 16:48:21 -07:00
Alex Vandiver
4f67c1dbf1 wal-g-exporter: Handle empty backup list, for new buckets. 2025-06-18 16:47:22 -07:00
Lauryn Menard
425abd83fc demo-orgs: Make password not required for demo org creation.
Creating a demo organization will not require the user to
set either an email or password, so explicitly set the
password field to not be required for that case.

Updates the form submitted in the dev environment to create
a new demo organization to not send a password value.
2025-06-18 16:47:09 -07:00
Kislay Verma
b4da918c00 compose_paste: Refactor is_safe_url_paste_target.
This commit eliminates a check which is covered just before
the call to this function, and renames it to better explain what
it does.
2025-06-18 14:10:10 -07:00
Kislay Verma
a62ee3f8e0 compose_paste: Don't paste formatted text at md link marker.
This prevents the case when we have text like `[abcd](url)`
in the compose box and the "url" part is selected, and we paste
a link copied from message actions popover.
2025-06-18 14:10:10 -07:00
Lauryn Menard
bfe5962853 help: Revise "Configure where you land in message feeds".
Updates instruction for selecting the desire configuration to
better match other similar mobile help instructions, e.g., "Manage
color theme".
2025-06-18 14:00:47 -07:00
Kislay Verma
1ece5ad15e topic_link_util: Add support for empty topics in the frontend.
Though the frontend module generated correct urls for
empty topics, it would sometime generate incorrect
link text in the fallback md link syntax. (eg, if
empty string was provided as the topic name).

This commit fixes that.
2025-06-18 13:03:56 -07:00
Kislay Verma
2a120d2717 topic_link_util: Support message links in backend.
This commit adds support for message link
(#**stream>topic@message_id**) syntax in the
backend `topic_link_util` module.
2025-06-18 13:03:56 -07:00
Kislay Verma
43bf15f0fa topic_link_util: Add support for empty topics in the backend.
Fallback links with empty topics now have correct
url and text for the "general chat" topic.
2025-06-18 13:03:56 -07:00
Mohammad Reza Kianifar
0a7227cfbb report_message: Use existing template for reporting 1:1 DM via DM group.
To maintain API compatibility during and after the migration to use
DirectMessageGroup for 1:1 messages, we need to build the existing
report message format for 1:1 DMs using DirectMessageGroup.
2025-06-18 12:46:23 -07:00
Mohammad Reza Kianifar
f4b6af5d42 push_notification: Use existing payload for 1:1 DM using DM group.
To maintain API compatibility during migration to DirectMessageGroup
for 1:1 DMs, generate notification payloads for such messages in the
same format as those sent to a Personal recipient.

Fixes: part of issue #25713.
2025-06-18 12:44:56 -07:00
Alex Vandiver
2b1e8c28b4 nagios: Make queue warnings message CZO. 2025-06-18 12:29:57 -07:00
Alex Vandiver
a0683927ef check_rabbitmq_queue: Relax paging thresholds for email_senders. 2025-06-18 12:29:57 -07:00
Alex Vandiver
483ced0b15 puppet: Upgrade dependencies. 2025-06-18 11:44:32 -07:00
Alya Abbott
46583240d6 help: Document list of topics in a channel. 2025-06-18 11:30:40 -07:00
Evy Kassirer
25664e87bd input_pill: Fix bug where focus indicator wasn't showing.
This bug was created in #34629 when we removed the transparent
border (which became not transparent on focus).
2025-06-18 11:30:25 -07:00
Maneesh Shukla
8a067b8871 icon_button: Clean up extra parameter. 2025-06-18 11:29:10 -07:00
Aman Agrawal
b77ecca1a3 user_pill: Use user_id to get user info instead of email. 2025-06-18 11:27:59 -07:00
Aman Agrawal
76313f1753 compose_typeahead: Check for unique full name syntax in query.
Add support for `full_name|user_id` syntax support for compose
typeahead.
2025-06-18 11:27:59 -07:00
Aman Agrawal
e20e4dcdbd user_pill: Mark full_name as always defined.
Since this data is always available to us, no need to mark it
as undefined as a possible case.
2025-06-18 11:27:59 -07:00
Aman Agrawal
89212ae680 people: Account for emails being split by " ,".
emails could be split by " ," and ",". So, trimming extra space
is important.
2025-06-18 11:27:59 -07:00
Aman Agrawal
b1f6eb41d9 zephyr/user_pill: Remove special condition for zephyr realm.
This makes user_id no longer optional in `UserPill` and hence,
we can query them by email instead of user_id.
2025-06-18 11:27:59 -07:00
PieterCK
0dfb916b6d user_profile: Fix the field for outgoing webhook bots interface.
This updates the `interface` field in the "Manage bot" modal and the
"Add a new bot" modal for service bots to "Webhook format".
2025-06-18 10:57:40 -07:00
whilstsomebody
a1b3448c01 test_message_delete: Add test for do_delete_messages grouping logic.
This commit adds a test for the grouping logic of the
`do_delete_messages` function, which now groups public and private
messages based on their streams and topics.
2025-06-17 19:45:36 -07:00
Tim Abbott
a94280ee9b message_delete: Avoid fetching Stream objects in loops. 2025-06-17 19:45:36 -07:00
whilstsomebody
5b6ae6eb7a message_delete: Refactor do_delete_messages to group messages by topic.
This refactor updates `do_delete_messages` to categorize messages by
recipient and topic using a `defaultdict`. Messages are grouped into
batches where each batch corresponds to a unique recipient and topic
combination. For each group, a separate delete event is created and
processed, ensuring compliance with API requirements that mandate one
event per topic.

Co-authored-by: Mateusz Mandera <mateusz.mandera@zulip.com>
2025-06-17 19:45:36 -07:00