Commit Graph

57575 Commits

Author SHA1 Message Date
Vector73 0f97733687 api_documentation: Document "/invites/{prereg_id}" endpoint. 2024-04-20 18:12:04 -07:00
sujal eba0097c7f message_feed: Modify tooltips to clarify draft saving.
Update the tooltips for the "Cancel" and "Spinner".  Provide clear
information about the draft saving behavior when a message fails to
send successfully.

Fixes part of #29100.
2024-04-20 18:00:22 -07:00
sujal shah f144400d46 settings: Change links to user_pills in invitations seciton.
Previously, links were displayed for the user's name,
but now they are presented as pills. These pills are rendered
using the user_display_only_pill.hbs template.
To obtain the avatar of a user,
the small_avatar_url_for_person function is utilized.
2024-04-20 16:59:45 -07:00
sujal shah 16db1df416 templates: Use 'panel_user_list' as classname.
The term 'subscriber' might be misleading as it doesn't accurately
reflect the purpose of the list, which simply contains all users
within the organization. To enhance clarity and maintain consistency,
I've replaced the classname 'panel_subscriber_member_list'
with 'panel_user_list'.
2024-04-20 16:59:45 -07:00
Kislay Verma 156c708614 compose: Refactor create_message_object.
This function now accepts an argument for message content in the
message object returned and use compose_state.message_content()
to preserve the behavior for existing callers.

Preparation for #28626
2024-04-20 16:24:54 -07:00
Kislay Verma ecac0d6c80 compose_ui: Refactor cursor_inside_code_block.
Renamed the function to position_inside_code_block and changed the
parameters to accept a string and number (index), and check if the
position in the string is inside a code block (as per previous logic).

Preparation for #28626.
2024-04-20 16:24:50 -07:00
Tim Abbott 7beea02660 compose_state: Reuse has_savable_message_content. 2024-04-20 13:29:22 -07:00
evykassirer 2c2dfa4c3d draft: Only auto-restore drafts edited since adding the feature. 2024-04-20 13:27:25 -07:00
evykassirer 43120709f7 narrow: Move clear_message_sent_banners into reset_ui_state. 2024-04-20 13:27:25 -07:00
evykassirer 160b78a7e9 drafts: Don't restore drafts being actively sent or scheduled. 2024-04-20 13:27:25 -07:00
evykassirer 45a81650f4 compose: Add option to not restore drafts, to avoid overwriting.
This could happen e.g. when quote-replying a message,
because we open the composebox before adding the quote
reply content. We need to make sure that we don't restore
a draft when opening the composebox, because otherwise
that draft will be replaced with the quote reply.
2024-04-20 13:27:25 -07:00
evykassirer 14d83458c8 drafts: Separate initialize function into data and UI pieces.
This will let us initialize the data before the UI is ready
to be initialized. We'll need to do this in an upcoming commit
where we clear a flag on page load before the reload code
initializes.
2024-04-20 13:27:25 -07:00
evykassirer 0e369e7ff3 compose_send_menu_popover: Rename module to reflect broader uses. 2024-04-20 13:27:25 -07:00
evykassirer 3ef4e80dff compose: Add button to save draft and start a new message. 2024-04-20 13:27:24 -07:00
evykassirer fd4246def5 drafts: Append a space to draft when restoring it.
If a user starts typing before they see that a draft was restored,
this makes that experience a little smoother by adding some
separation between the old draft and the new text.
2024-04-20 12:31:51 -07:00
Riken Shah d48de6da08 compose: Restore the last draft when compose box is opened.
Now when the user opens a narrow that has a draft saved for
that particular conversation, the draft will automatically
be restored in the compose box. This will make it easy to
return to a draft after clicking away, and also will make
it less confusing when people close the compose box by
accident. Note that this only restores the draft when
there is a full recipient specified (stream and topic,
or at least one PM recipient).

Fixes part of #18555.
Fixes #11218 and #17396.
2024-04-20 12:31:51 -07:00
evykassirer cb3f22c30e drafts: Delete a draft if it is cleared from the compose box.
We used to keep the draft, assuming that clearing the composebox
was an accident. Now we want to delete the draft, in preparation
for auto-restoring drafts when opening the composebox for narrows
with drafts associated with them. If a user opens the composebox
and sees a draft they don't want anymore, clearing the box is a
way we expect them to try to delete it.
2024-04-20 12:31:51 -07:00
sujal shah 01e898252b setting_ui: Fix sorting by "Invited by" column.
Previously, the sorting was broken due to
incorrect referencing of the property.
The code has been updated to use the "referrer_name"
property instead of "ref".
2024-04-20 12:28:39 -07:00
Kenneth Rodrigues 5db24e002c narrow-parameter: Add validation for the narrow parameters. 2024-04-20 09:04:26 -07:00
Kenneth Rodrigues def2d402f4 message-flags: Migrate message flag endpoints to typed_endpoint. 2024-04-20 09:04:26 -07:00
Aman Agrawal 07699eb1d2 message_fetch: Allow updating fetch status without updating messages.
It's possible that for a given narrow event if we didn't fetch any
messages in the `num_after` or `num_before` space, we could have
arrived at `newest` or `oldest` messaged based on the `anchor` used.

This fixes the bug where `fetch_status` for `found_newest` didn't
update to be `true` when using `newest` anchor and `num_after = 0`.
2024-04-20 08:49:54 -07:00
Aman Agrawal fb8a05a683 server_events: Rename home_view_loaded related variables.
Gave them a more general name which reflected what they were
really doing.
2024-04-20 08:49:54 -07:00
Aman Agrawal 6d7856fa37 message_list_data: Move comments to the type definitions. 2024-04-20 08:49:54 -07:00
Lauryn Menard 1d5897060a audit-logs: Add index to RealmAuditLog for realm and event type.
Adds an index on RealmAuditLog for the realm, event_type, and
event_time in order to improve database queries on these audit logs.

tabbott verified using EXPLAIN ANALYZE that this also considerably
speeds up queries that order by ID rather than event_time, but
event_time is how these should be ordered given the possibility of
backfills.
2024-04-19 17:58:59 -07:00
Mateusz Mandera 962ab13203 push_notifs: Make push_notifications_enabled more resistant to flapping.
Fixes #28403

Uses redis to remember the last time push notifications were experienced
working. This needs to work across processes, so can't be done just in
memory.
As this is transient data that's fairly harmless to lose and thus
doesn't require the persistence benefits of the database, and we're
keeping a single "row", so don't need an entire new db table, we settle
on using redis instead of postgres. This is also consistent with how we
store other kinds of such transient data.
2024-04-19 10:25:34 -07:00
Mateusz Mandera 630335142a rate_limiter: Extract KEY_PREFIX to redis_utils. 2024-04-19 10:25:34 -07:00
Ujjawal Modi 706c380971 audit_log: Update audit log entries created while creating a group.
Earlier a extra audit log entry of type
USER_GROUP_GROUP_BASED_SETTING_CHANGED was made when a new user
group is created. This commit updates the code to not create
that audit log entry.

There is no need to create these entry as we would still
have the required data from the "OLD_VALUE" field in the
audit log entry created when changing the setting and this
also makes it consistent with the entries created for
other operations like stream creation.
2024-04-19 10:18:45 -07:00
Aman Agrawal 42bbeb6247 stripe: Change pricing for plus plan.
This also now allows user to upgrade to plus plan from pricing page.

Note that since we don't pass customer_plan on pages like self-hosting
and for/business, `Current plan` status is not displayed on these pages.
2024-04-19 09:57:43 -07:00
Alex Vandiver 49422c05c8 kandra: Add teleport services to "needsrestart" skip list.
These are often how one is connected to the node, and restarting them
would drop the connection one us actively using.
2024-04-19 09:55:17 -07:00
Prakhar Pratyush 6ae7ed580e api_docs: Fix the example JSON error response for 'POST /typing'.
In 5e30ab91b9, we introduced
'stream_id' parameter. 'to' is no longer used when composing
stream messages to specify the stream ID.

Earlier, 'to' parameter accepted a single element list
containing the ID of the stream.

Since we can't specify multiple stream IDs anymore, the
example JSON error response documented is stale.

This commit updates that.
2024-04-19 09:54:54 -07:00
Alya Abbott ac3dd5e076 portico: Add more detail to title in quote. 2024-04-19 09:54:22 -07:00
Tim Abbott 342a9bd5cd zulip_updates: Prevent racing with self using a lock. 2024-04-18 15:14:02 -07:00
Tim Abbott 5c5e6b8cc5 zulip_updates: Protect against race with ourself. 2024-04-18 15:14:02 -07:00
Tim Abbott 5565bcf64f zulip_updates: Don't run Markdown inside a transaction.
This isn't safe because of the use of unsafe_timeout in this code
path.
2024-04-18 15:14:02 -07:00
Anders Kaseorg 3b4527843d requirements: Upgrade Django to 5.0.5.dev.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-18 12:39:47 -07:00
Aman Agrawal ca0f79ce34 message_list_view: Restore date on previous sticky header.
We forgot to restore the date on sticky header if the header
is no longer sticky.

Reproducer:
* Have two messages with same sender on different dates next to
  each other in a stream narrow.
* Scroll so that sticky header is on the 2nd message.
* Scroll down fast so that to avoid us capturing the sticky header
  over the first message.
* Scroll up slowly so to see the group header of the messages have
  the date of the second message.
2024-04-18 11:52:59 -07:00
Tim Abbott 951a474376 populate_db: Don't enqueue push notifications service updates.
Since we're just creating an initial database state, there's no reason
we need to submit increment analytics updates to the bouncer service;
such updates will happen during queue worker startup, if needed.
2024-04-18 11:51:42 -07:00
Anders Kaseorg 72018cc26b timeout: Rename to unsafe_timeout.
This timeout strategy using asynchronous exceptions has a number of
safety caveats (read the docstring!!) and should only be used in very
specific circumstances.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-18 11:50:38 -07:00
Anders Kaseorg 631c2f7d4c test_helpers: Remove unused timeout_mock.
We don’t want to encourage more uses of zerver.lib.timeout.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-18 11:50:38 -07:00
Anders Kaseorg da979bc65c streams: Remove inappropriate use of zerver.lib.timeout.
zerver.lib.timeout abuses asynchronous exceptions, so it’s only safe
to use on CPU computations with no side effects.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-18 11:50:38 -07:00
Anders Kaseorg 95a1481f99 message_flags: Remove inappropriate use of zerver.lib.timeout.
zerver.lib.timeout abuses asynchronous exceptions, so it’s only safe
to use on CPU computations with no side effects.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-04-18 11:50:38 -07:00
Lauryn Menard b71f4b9342 stream-settings: Remove unused tooltip for announcement stream.
In commit 449febf036, the tooltip that provided information about
the announcement stream was replace with inline text on the form.

Removes the now unused template and code in stream_create for this
tooltip.
2024-04-18 08:52:53 -07:00
Pratik Chanda 3f1ffd0068 topic_list: Show topic row for empty conversations in left sidebar.
Earlier when a user narrowed to a new topic, there was no highlighted
topic row entry in the left sidebar under the respective stream.

This commit introduces the feature to show highlighted topic in the
left sidebar for a new topic thread. It checks if narrowed topic is
present in the list of topic names to add to it.
It disappears from the left sidebar when unnarrowed and the topic
contains no messages.

Fixes: zulip#22769.
2024-04-17 17:51:12 -07:00
Pratik Chanda e1a63d57a2 pm_list: Show DM row for empty conversations in left sidebar.
Earlier when a user narrowed to a new pm conversation, there was no
highlighted DM row entry in the left sidebar.

This commit introduces the feature to show highlighted pm thread in
the left sidebar for a new conversation. It adds narrowed dm to the
recent messages list if not already present.
It disappears from the sidebar if no message was sent and unnarrowed
from the DM.

Fixes: zulip#22769.
2024-04-17 17:51:12 -07:00
Alya Abbott 4c5fa7aaf7 portico: Fix typo. 2024-04-17 17:42:10 -07:00
Alex Vandiver a4e6037dc4 kandra: Automate the second step of configuring database replicas.
If there is a replication primary configured, and no current database,
then we check all of the required secrets are in place, then pull down
the latest backup and trigger a PostgreSQL restart, which will pick up
downloading the remaining WAL logs to catch up, then start streaming
from the configured primary.
2024-04-17 17:31:49 -07:00
Alex Vandiver d893a2a29e kandra: Install the right PostgreSQL. 2024-04-17 17:31:49 -07:00
Alex Vandiver a8dbdd6d92 kandra: Ensure that pg_hba.conf is in place before starting PostgreSQL. 2024-04-17 17:31:49 -07:00
Alex Vandiver 311dfdaa38 puppet: Only restart PostgreSQL if there is a datadir to read.
This is specifically to support Kandra's `setup_disks`, which stops
PostgreSQL and moves the data directory out of the way while mounting
a new disk; restarting PostgreSQL would fail in this state.  We
install secrets and re-run puppet to finish bootstrapping the
database, all of which expects the PostgreSQL server to be stopped
anyways.
2024-04-17 17:31:49 -07:00
Alex Vandiver 4be2abc55b puppet: If needed, ensure wal-g is installed before we start PostgreSQL.
PostgreSQL will need to use wal-g to pull needed WAL files.  We do not
express this as a direct dependency because it is possible to have
wal-g without PostgreSQL, as well as PostgreSQL without wal-g.
2024-04-17 17:31:49 -07:00