Commit Graph

60222 Commits

Author SHA1 Message Date
Prakhar Pratyush e474ab7ee0 streams: Add transaction.atomic decorator to 'do_rename_stream'.
This commit updates the 'do_rename_stream' action function
to make the db operations atomic.

Also, send_event is replaced with send_event_on_commit.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 69dec9dbc6 streams: Update 'do_change_stream_post_policy' to send event on commit.
Earlier, we were using 'send_event' in do_change_stream_post_policy
which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 41d947b89d streams: Make db operations in do_change_subscription_property atomic.
This commit adds a transaction.atomic decorator to the
'do_change_subscription_property' function to make
the db operations in the action function atomic.

Also, send_event is changed to send_event_on_commit.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 5d0b3d1a6d muted_users: Update 'do_unmute_user' to send event on commit.
Earlier, we were using 'send_event' in 'do_unmute_user'
which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 3b9a21443a muted_users: Update 'do_mute_user' to send event on commit.
Earlier, we were using 'send_event' in 'do_mute_user' which
can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 9026e6ecc1 message_flags: Update 'do_update_message_flags' to send event on commit.
Earlier, we were using 'send_event' in do_update_message_flags
which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 32a4a112b1 message_flags: Update do_mark_muted_user...read to send event on commit.
Earlier, we were using 'send_event' in
'do_mark_muted_user_messages_as_read' which can lead to a
situation where we enqueue events but the function fails at a
later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 62eb850423 message_flags: Update transactions to be durable in do_mark_all_as_read.
In 'do_mark_all_as_read', the transactions which mark the messages
as read in batches should be marked as durable to avoid addition
of any outer atomic block as we support marking a few batches
(not all messages) as read in the case of a timeout.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush 64beea2765 message_flags: Update 'do_mark_stream...read' to send event on commit.
Earlier, we were using 'send_event' in do_mark_stream_messages_as_read
codepath which can lead to a situation where we enqueue events but the
function fails at a later stage.

Events should not be sent until we know we're not rolling back.

Fixes part of #30489.
2024-08-19 10:14:49 -07:00
Prakhar Pratyush ed512f06bb message_edit: Queue event on commit in do_update_message codepath.
'do_update_message' is within a db transaction, this commit
updates the 'do_clear_mobile_push_notifications_for_ids' function
used in 'do_update_message' to queue event on commit.

Events should not be sent until we know we're not rolling back,
otherwise it can lead to a situation where we enqueue events but
the function fails at a later stage.
2024-08-19 10:14:49 -07:00
Tim Abbott a3806b4165 migrations: Fix quoting bug in tutorial_status migration.
Fixes #31381.
2024-08-17 22:17:21 -07:00
bedo 00c9f36434 create stream: Bulk conversion of principals to UserProfiles.
Previously, this logic did the database queries to look up UserProfile
objects in a loop.

Fixes #21820.

Significantly improves Stream creation time and also unsusbcribing users.
Tested stream creation with 10k stream subscribers:

- before: 127 seconds ~2 mins
- after: 17 seconds ~0.3 min

Add a test case for user unsubscribing themself.
2024-08-16 17:46:19 -07:00
Lauryn Menard 3d58a7ec04 remote-support: Add ability to configure temporary courtesy plan.
Expands section for scheduling plans in the remote support view to
have a form to create a temporary courtesy plan (aka our legacy
plan for remote servers and realms).

Form is not shown if there is a current plan for the remote billing
entity, and would raise a SupportRequestError in that case as well.
2024-08-16 16:40:18 -07:00
Kenneth Rodrigues f27cee21e3 tutorial documentation: Add documentation for typed_endpoint. 2024-08-16 16:17:43 -07:00
Kenneth Rodrigues 748a56aae9 docs: Fix missing parenthesis in writing-views.md. 2024-08-16 16:17:43 -07:00
Alex Vandiver 854ec40def home: Add rel=dns-prefetch to Gravatar and any Zulip avatar host.
This hints to the browser that it should start DNS lookups for the
host, since it is likely to be necessary.  It is a softer form than
`rel-preconnect`, which may be unnecessary in these cases, if the
client has the resources cached already.
2024-08-16 14:33:25 -07:00
Alex Vandiver 00dfb60f5b avatars: Mark as lazy-loaded.
Similar to the previous commit, defer loading avatar images until they
are actually likely to be seen.
2024-08-16 14:33:25 -07:00
Alex Vandiver 2f2803431d thumbnails: Mark images as lazy-loaded.
Setting `loading=lazy`[^1] tells the browser to defer loading the
image until it is near enough to the viewport to merit loading.  This
can save a great deal of image fetching.

[^1]: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#lazy-loading-attributes
2024-08-16 14:33:25 -07:00
Aman Agrawal 029839ea21 puppeteer: Use a robust method to verify if we switched narrow.
Just verifying that a `message-list` is rendered is not enough to
ensure that we are in the correct narrow. We need to check
if we are narrowed to the correct message list id.

This prevents CI from failing unexpectedly.
2024-08-16 14:00:24 -07:00
Shubham Padia 72bbf8b152 user_card_popover: Pass correct popover element for person picker.
Fixes #31345.
We were using `e.target` as the popover element for the person picker
which meant that the popover would either open just beside the user's
image or the user's name text, both of which would cover the close icon.
The popover element is now the entire pill by using `e.currentTarget`.
2024-08-16 13:59:42 -07:00
Karl Stolley f55feae0ea search: Reset default iOS button styles. 2024-08-16 13:58:50 -07:00
Alex Vandiver dd5b03ea12 wal-g: Support setting the compression method. 2024-08-16 13:57:58 -07:00
Alex Vandiver 1e5c0dc259 kandra: Bump Teleport version to 16. 2024-08-16 08:51:15 -07:00
Lauryn Menard cabe0b2e05 api-docs: Update topics array description in get-stream-topics response. 2024-08-15 18:27:43 -07:00
Tim Abbott 8c6d61f4a6 node tests: Improve documentation for message_list_view test. 2024-08-15 18:24:43 -07:00
evykassirer 9b78cc3240 message_list: Reduce _RENDER_WINDOW_SIZE to 250.
The message feed can take long enough to render that
users are locked out of clicking things for a second
or so. This has become especially an issue since we
updated the search bar logic to refresh the message
feed as search terms are added to the search bar.

More details on CZO here:
https://chat.zulip.org/#narrow/stream/101-design/topic/search.20narrow.20live.20update
2024-08-15 18:15:51 -07:00
evykassirer 5607d840e5 message_list_view: Add test helper to calculate move ranges. 2024-08-15 18:15:50 -07:00
evykassirer 039037e64f message_view: Use stream id instead of name for activate_stream_for_cycle_hotkey. 2024-08-15 17:16:22 -07:00
evykassirer 6f4b009c90 topic_generator: Use stream id instead of stream name. 2024-08-15 17:16:22 -07:00
evykassirer 5cc5659010 stream_data: Remove unused home_view_stream_names. 2024-08-15 17:16:22 -07:00
evykassirer 90cced31af stream_data: Remove is_stream_muted_by_name to favor stream ids. 2024-08-15 17:16:22 -07:00
evykassirer fd5112fbb2 message_list: Use stream id instead of name in update_trailing_bookend. 2024-08-15 17:16:22 -07:00
evykassirer 7203244015 stream_data: Fix return type of stream_info.get.
We can definitely be looking up stream ids that don't map to
anything. All callers already assume it can be undefined.
2024-08-15 17:16:22 -07:00
evykassirer 9dab566d10 filter: Canonicalize operator before creating parsed term.
We decide what operators are valid when parsing a term by
calling `operator_to_prefix`, but `operator_to_prefix` calls
`canonicalize_operator`, so we need to call `canonicalize_operator`
on the operand we return from `parse`, or else we might end up
with an invalid operator in a parsed term.

Fixes this bug:
https://chat.zulip.org/#narrow/stream/9-issues/topic/valid.20search.20terms.20in.20uppercase.20followed.20by.20.3A.20throwing.20error
2024-08-15 17:13:36 -07:00
Shubham Padia 620970c46d user_group_popover: Show popover on group mention in drafts overlay.
Fixes #31102.
It would be good to have defined the event listener in
`user_group_popover.js` to keep everything in one place, but since direct
event handlers were getting invoked before delegated event handlers, we
had to define direct event handlers in the launch function of drafts
overlay ui.
2024-08-15 16:28:55 -07:00
Shubham Padia 29809ea61b user_group_popover: Show popover on all .messagebox user group mention.
Show user group popover for scheduled messages overlay, compose box
preview, message edit preview, message edit history.
`.messagebox` was chosen as the selector since that was the nearest
parent class that was common for all of the above.

This commit won't work for drafts overlay since drafts has a direct
event listener which receives the event before our delegated event
listener.

This commit also adds an explicit `cursor: pointer` to
`user-group-mention`.
2024-08-15 16:28:53 -07:00
Shubham Padia 2b3a41be58 user_card_popover: Show popover on all .messagebox user mention.
Show user card popover for scheduled messages overlay, compose box
preview, message edit preview, message edit history.

`.messagebox` was chosen as the selector since that was the nearest
parent class that was common for all of the above.

`@all` does not have a popover and that's why it will have the same
pointer as its parent element. We also introduce a new class called
`.user-mention-all` for managing css rules specific to that mention.
2024-08-15 16:28:08 -07:00
Shubham Padia d983d0ec2e user_card_popover: Show popover on user mention in drafts overlay.
We introduce `has_message_context` as an additional argument to
`toggle_user_card_popover_for_message`. `has_message_context` is set to
false for all messages that have not been sent yet i.e. drafts and in
the future commits: scheduled messages, compose box, edit message box.

It would be good to have defined the event listener in
`user_card_popover.js` to keep everything in one place, but since direct
event handlers were getting invoked before delegated event handlers, we
had to define direct event handlers in the launch function of drafts
overlay ui.
2024-08-15 16:23:26 -07:00
Shubham Padia 0cede4cca6 user_card_popover: Remove unused user `undefined` check.
This was introduced in 3c7e470cfb, and
since the comment said it should never happen, it felt safe enough to
remove.

The `message` argument has also been replaced with `sender_id` since
that is the only property we need from the message now. This will
become useful in adding support for these popovers to compose box where
the message object will not be present but there would be a sender_id.
2024-08-15 16:23:26 -07:00
Shubham Padia ddef232c42 user_card_popover: Remove redundant message_user_card.is_open() check.
Even without the check, mutliple message_user_cards will not be opened
by the app.
2024-08-15 16:23:26 -07:00
Aman Agrawal aac75f87f9 message_view: Update narrow title after change in narrow filter.
This needs to be done to update narrow title for different
`near` message targets or no `near` topic narrows.
2024-08-15 16:17:46 -07:00
Prakhar Pratyush 52a9846cdf user_profile: Remove 'tutorial_status' field.
The 'tutorial_status' field on 'UserProfile' model is
no longer used to show onboarding tutorial.

This commit removes the 'tutorial_status' field,
'POST users/me/tutorial_status' endpoint, and
'needs_tutorial' parameter in 'page_params'.

Fixes part of zulip#30043.
2024-08-15 13:31:40 -07:00
Prakhar Pratyush ee806c49b9 ui_init: Use OnboardingStep for narrowing on first web app load.
We plan to remove the 'tutorial_status' field from UserProfile
table as it is no longer used to show tutorial.

The field is also used to narrow a new user in DM with
welcome bot on the first load.

This prep commit updates the logic to use a new OnboardingStep
for the narrowing behaviour on the first load. This will help
in removing the 'tutorial_status' field.
2024-08-15 13:31:40 -07:00
Prakhar Pratyush 13c0571183 message_fetch: Use email as operand for 'dm' operator.
In our web client code we use email as the operand for
'dm' operator. Later user_ids_array is set as operand
in 'handle_operators_supporting_id_based_api' before
making the API call.

Earlier, using user_id as the operand was resulting in
the following error during user signup:
data=b'{"result":"error","msg":"Invalid narrow[0]: Value error,
operand is missing","code":"BAD_REQUEST"}

This commit replaces user_id with email as operand.
2024-08-15 13:31:40 -07:00
PieterCK d974c10efc integration-docs: Update Open Collective for new doc format.
Other than reformatting documentation for Open Collective, this
commit also moves it to the "Financial" category from "Communications".
This is because Open Collective is mainly a fundrising + legal status +
money management platform, as stated in https://opencollective.com/.

Part of #29592.
2024-08-15 13:16:14 -07:00
PieterCK 00f9892d8d integration-docs: Update Mention for new doc format.
Part of #29592.
2024-08-15 13:16:14 -07:00
PieterCK 07fda86ff9 integration-docs: Update Netlify for new doc format.
Besides reformatting the Netlify doc, this commit also updates the
instructions to match some UI changes in Netlify. The "Outgoing Webhook"
menu is now called "HTTP Post request".

Part of #29592.
2024-08-15 13:16:14 -07:00
PieterCK 9494620022 integration: Delete Opbeat integration.
Opbeat was acquired by Elastic in 2017[1] and maintained until Elastic
APM went live[2]. Now that Elastic APM is online, it looks like Opbeat
repositories have been marked as archived/unmaintained[3].

[1]: https://www.elastic.co/blog/welcome-opbeat-to-the-elastic-family
[2]:
https://www.elastic.co/observability/application-performance-monitoring
[3]: https://github.com/opbeat
2024-08-15 13:16:14 -07:00
Tim Abbott 60eb621477 help: Update documentation for new deletion feature. 2024-08-15 12:03:49 -07:00
Vector73 80969a62e6 settings: Add `can_delete_any_message_group` setting.
Fixes #30717.
2024-08-15 12:03:49 -07:00