Commit Graph

57116 Commits

Author SHA1 Message Date
Temidayo32 533a6153b2 compose_validate: Convert module to TypeScript. 2024-03-22 15:59:37 -07:00
Varun Singh fd3c7728fc message_list_tooltips: Convert module to TypeScript. 2024-03-22 15:37:57 -07:00
Varun Singh b0377d5d6d message_list_tooltips: Create '$template' conditionally.
We only expect 'data-tooltip-template-id' to be present if 'tippy_content'
is not valid.Hence, only when 'tippy_content' is undefined, should we create
'$template'.
2024-03-22 15:37:57 -07:00
Varun Singh 92ba149f5f message_list_tooltips: Consistently pass 'target' as 'string' argument. 2024-03-22 15:37:31 -07:00
Varun Singh 92c8b89ce2 message_list_tooltips: Return 'undefined' to satisfy tippy upstream. 2024-03-22 15:35:49 -07:00
N-Shar-ma b6a04aaa83 typeahead: Add option for word order not mattering for query matching.
Uptil now, the `query_matches_string_in_order` function would respect
the order of words in the query string when matching a source string.
This meant that for query "two one", the source string "one two three"
would not be matched.

For more flexibility, a new function, `query_matches_string_in_any_order`,
has been added., which returns true if each word in the query string matches
the prefix of a distinct word in the source string, else it returns false.

The algorithm for computing this is quadratic in terms of the source word
count so can be a little expensive, but it is only currently used for
searching topics in Recent Conversations, where the strings' length is
limited by the max stream / topic name length allowed, so this should be
performant enough for this use case.
2024-03-22 15:20:40 -07:00
N-Shar-ma c503a846ba refactor: Rename `query_matches_string` to `query_matches_string_in_order`.
The function is renamed for clarity.

Prep commit for next commit which adds a similar function where order
does not matter.
2024-03-22 15:20:40 -07:00
N-Shar-ma 5d83e53ca5 typeahead: Treat query and source string in the same way before matching.
Like the source string, now the query too is converted into lower case
and has diacritics removed, before trying to determine a match.
2024-03-22 15:20:40 -07:00
Anders Kaseorg 0cc40605b0 semgrep: Broaden select_related() and prefetch_related() rules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-22 18:01:57 -04:00
Aditya Bajaj a20b454ebb
notifications: Shorten string for redacted content.
Replace the long string for organisations that have notification
body/content disabled (settings.PUSH_NOTIFICATION_REDACT_CONTENT
set to true) with "New message".

This allows more of the limited space on the mobile device screen to
be used for additional messages rather than this verbose content.

Fixes #29152
2024-03-22 09:37:51 -07:00
Alex Vandiver 92fa9ee78c util: Use the same regex as the backend for wildcard mentions. 2024-03-22 09:36:12 -07:00
Mateusz Mandera 89a22fb076 register_server: Check write access to secrets file when rotate_key.
Using --rotate-key without write access to the secrets file is currently
quite painful, since you end up rotating your registration's secret with
no local record of it; so effectively you lose your registration and
need help from support. We should just prevent this failure mode.
2024-03-22 09:33:00 -07:00
Alex Vandiver 7d0c12aa3a semgrep: Enforce no bare select_related() calls.
Previously, #26419 addressed the majority of these calls, but did not
prevent more from creeping in.  Remove the one remaining
callsite (after the cleanup from the previous commits), and ban any
future use of the pattern.
2024-03-22 09:30:17 -07:00
Alex Vandiver fd5a091b30 messages: Only check the UserMessage row if necessary.
For the common case of not needing to reference the UserMessage row
later, and for being a stream without private history, the UserMessage
row is irrelevant.  Convert `has_user_message` to a thunk, and defer
loading it unless necessary.
2024-03-22 09:30:17 -07:00
Alex Vandiver f92d43c690 messages: Use overloads to only return a user_message if needed. 2024-03-22 09:30:17 -07:00
Alex Vandiver 6ace34c374 messages: Stop joining through every table.
Calling `.select_related()` with no arguments joins through every
possible table, recursively.  In this case, this currently produces a
query which joins through forty-three tables.

This is rather inefficient, particularly for what is a very common
call which should be very fast.

No callsite depends on having prefetched any joined table on the
object; drop all of the joins.
2024-03-22 09:30:17 -07:00
John Lu a5cf0ec526
refactor: Replace HUDDLE with DIRECT_MESSAGE_GROUP.
Replaced HUDDLE attribute with DIRECT_MESSAGE_GROUP using VS Code search,
part of a general renaming of the object class.

Fixes part of #28640.

Co-authored-by: JohnLu2004 <JohnLu10212004@gmail.com>
2024-03-21 16:39:33 -07:00
Anders Kaseorg 224b484195 test_classes: Skip OpenAPI validation on exceptions.
This gives more helpful error tracebacks from failing tests.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 16:36:48 -07:00
Varun Singh 1aaedf89ee poll_modal: Convert module to TypeScript. 2024-03-21 16:33:24 -07:00
Alex Vandiver e06b1794a8 kandra: Template and insert email credentials. 2024-03-21 16:14:44 -07:00
Alex Vandiver 75411b264e kandra: Remove unnecessary libapache2-mod-wsgi.
It does not exist in 22.04, and its last use was removed in
61666a9262.
2024-03-21 14:23:30 -07:00
Alex Vandiver 9d8d2d138b missedmessage_emails: Add Sentry spans to worker thread. 2024-03-21 12:46:13 -07:00
Alex Vandiver 9451d08bb9 worker: Split out worker sampling rate, and add Sentry transactions. 2024-03-21 12:46:13 -07:00
Alex Vandiver f64b9475c1 sentry: Optionally enable tracing, with transactions and spans. 2024-03-21 12:46:13 -07:00
Alex Vandiver 3cbce0c5c7 missedmessage_emails: Clear caches and db query tracking per-loop.
Otherwise, these accumulate and leak memory.
2024-03-21 12:46:13 -07:00
Alex Vandiver 23504308fb puppet: Install the same version of postgres-client as the server.
We require a `pg_dump` whose version matches the version of the server
we are configured against (see 3a8b4b0205).  Installing the latest
`postgresql-client` does not guarantee that we have such a binary
present.
2024-03-21 12:34:34 -07:00
Alex Vandiver 6ad777c86f dev_urls: Make requests to /docs redirect to the index.
This makes it easier to browse to the docs in development mode, and
more closely matches ReadTheDocs production.
2024-03-21 11:27:14 -07:00
Vector73 f758ca596b custom_profile_fields: Add "required" parameter to the profile fields.
Fixes #28512.
2024-03-21 10:48:54 -07:00
Tim Abbott ac0673e0b5 settings: Rename overly generic field and field_hint classes. 2024-03-21 10:48:54 -07:00
Tim Abbott 9786a16680 bot_avatar_row: Rename extremely generic CSS classes.
I fixed one apparent typo, `$row.find("api_key_error").hide();`, while
doing this.
2024-03-21 10:48:54 -07:00
Tim Abbott e436aea917 change_password: Avoid super generic CSS classes. 2024-03-21 10:48:54 -07:00
afeefuddin 6f81fe1b5b info_overlay: Convert module to TypeScript. 2024-03-21 09:00:33 -07:00
Anders Kaseorg e3340774ce requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 08:59:17 -07:00
Anders Kaseorg 71e1b3c91b sentry: Fix type error in add_context.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 08:59:17 -07:00
Anders Kaseorg eb622bae0a ruff: Fix S605 Starting a process with a shell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 08:59:17 -07:00
Anders Kaseorg a1a341f0ae ruff: Fix UP032 Use f-string instead of `format` call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 08:59:17 -07:00
evykassirer f1b8e11e8b narrow: Remove stale comment about deactivate(). 2024-03-20 19:11:25 -07:00
evykassirer ba215e3e80 buddy_list: Ensure users are visible when hide_headers is true. 2024-03-20 18:47:24 -07:00
evykassirer 1defce3172 composebox_typeahead: Don't use typeahead to store `completions`.
It wasn't being used in the typeahead, just hackily being
referenced within composebox_typahead.
2024-03-20 13:08:26 -07:00
evykassirer d5d505a561 typeahead: Remove unneeded eventSupported.
It will always be true.
2024-03-20 13:08:26 -07:00
evykassirer 596233e14d typeahead: Default options to undefined instead of null. 2024-03-20 13:08:26 -07:00
Lauryn Menard 373671080d remote-support: Include billing entity name in internal billing notice.
Adds a line to the top of the internal_billing_notice email with
the billing entity's display name.

Makes sure all internal_billng_notice email subjects also include
the billing entity's display name.

Makes small updates to the notice text for some cases.
2024-03-20 11:58:15 -07:00
Prakhar Pratyush 118a7e8d9d zulip_updates: Send zulip updates based on zulip_update_*_level.
This commit adds a management command that will run regularly
as a cron job to send zulip updates to realms based on their
current and latest zulip_update_announcements_level.

For realms with:
* level = None: Send a group DM to admins notifying them about
this new feature & suggestion to set the stream accordingly.

* level = 0:
  * If stream is still not configured, wait for a week
    before setting their level to latest level. They will
    miss updates until their configure the stream.
  * If stream is configured, send updates.

* level > 0: Send one message/update per level & increase
  the level by 1 till the latest level.

Fixes #28604.
2024-03-20 11:48:06 -07:00
Prakhar Pratyush 336d46001c message_send: Add 'internal_prep_huddle_message' function.
This is a prep commit to extract out the logic to
create message from 'internal_send_huddle_message'
into a separate function 'internal_prep_huddle_message'.

We will use this new function to get the huddle message
without sending it immediately.
2024-03-20 11:48:06 -07:00
Prakhar Pratyush 23fc04577b message_send: Don't create savepoint in do_send_messages.
In general, we never want to use savepoints.

This prep commit adds savepoint=False in do_send_messages
as we don't want to just rollback to this savepoint and
proceed if we encounter any error while sending zulip updates
via cron.
2024-03-20 11:48:06 -07:00
Prakhar Pratyush 6484532830 help: Migrate configure-notification-bot help page to a new URL.
This commit migrates the 'help/configure-notification-bot' help
page to a new URL i.e. 'help/configure-automated-notices'.
2024-03-20 11:48:06 -07:00
roanster007 3d152296f6 message_view: Fix error thrown on deleting stream and searching for it.
Previously, when a stream is deleted and the deleted stream is looked
up in the search bar, then an error is thrown.

This is because, when the StreamSubscription object of the deleted
stream is fetched we try to access its properties - invite_only and
is_web_public, despite it being undefined.

This is fixed by accessing the properties only when the object is not
undefined.
2024-03-20 09:59:10 -07:00
Aman Agrawal 446de85e76 upgrade: Minor text edits. 2024-03-20 09:38:19 -07:00
tnmkr e1b101ceec docs: Fix incorrect function typo in events system. 2024-03-20 09:32:44 -07:00
Eklavya Sharma fb0697f266 docs: Fix typos in the Hindi translation guide. 2024-03-20 09:15:21 -07:00