Commit Graph

60212 Commits

Author SHA1 Message Date
bedo 5d7615879f rate_limiter: Block IPv6 by /64.
Fixes #21544.

rate limits IPv6 by /64 prefx rather than individual addresses,
this makes all IPs of the same /64 belong to the same bucket.
2024-09-11 00:04:36 +03: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
evykassirer dc938768ca message_edit: Avoid use of e.target.
This commit changes some event handlers to pass in relevant
JQuery objects instead of using `e.target`. This will be
necessary for converting message_edit to typescript.
2024-08-15 10:08:07 -07:00
evykassirer b0c90c0ba2 message_edit: Remove unused topic edit code.
`message_edit_topic_propagate` is only used in the template for
moving messages, separate from the message edit template, and
`message_edit_topic` doesn't show up anywhere anymore. Editing
the topic of a message used to be part of the message edit file,
and was removed in 0fc19732bc (diff-c68d68d71e21a4d22f39212a43e4f66ecc774bd17109963fe017d9878aace9bf)
2024-08-15 10:08:07 -07:00
Lauryn Menard 73029c8348 support: Show sponsorship and discount headers for Zulip Cloud. 2024-08-15 09:51:35 -07:00
Lauryn Menard 391c52639f support: Show discount information on remote support views.
In commit 7203661d99, we removed the default_discount field on the
Customer model, but we didn't update the remote support views for
this change.

Adds a has_discount boolean to the SponsorshipData that's used in
the support views for headers, and updates the discount information
on a deactivated remote realm to show any pre-existing discounted
prices.
2024-08-15 09:51:35 -07:00
evykassirer fc2ce3deb2 search: Fix bug preventing closing regular search pills.
In an earlier refactor, `removePill` was being called with the exit
button element instead of the pill. This change fixes that bug by
using similar code to what we previously did (and still do in
input_pill for cases without on_pill_exit).
2024-08-15 09:49:12 -07:00
Prakhar Pratyush c0ac38fe8a docs: Update the stale links in "Set up Git" docs. 2024-08-15 09:46:31 -07:00
roanster007 e104fed6ef echo: Extract the waiting for id and ack into separate module.
This commit extracts the "waiting_for_id" and "waiting_for_ack"
data structures of "echo.js" into a separate module in "echo_state".

This is a preparatory commit so as to be able to use them for
"stream_topic_history" module, without causing import cycles.
2024-08-14 18:24:56 -07:00
Prakhar Pratyush 19d56f77b5 rocketchat: Fix "OSError: [Errno 36] File name too long" error.
Earlier, we were replacing too long attachment name with random uuid
when the character count of the file name was greater than 255.

This results in "OSError: [Errno 36] File name too long" error in
few cases when the file name has less than 255 characters but more
than 255 bytes (file name with Non-ASCII characters).

This commit updates the code to check the file name's byte size
instead of characters count.
2024-08-14 18:18:31 -07:00
Prakhar Pratyush 54492ec7a0 help: Add a note in "Export your Rocket.Chat data" section.
This commit adds a note to NOT shut down Rocket.Chat server
while creating database dump using mongodump utility because
as this results in bugs like empty instances.bson file and
empty uploaded data after import.
2024-08-14 18:18:31 -07:00
Prakhar Pratyush adae69c65f help: Document rocketchat's livechat channels/messages not imported.
We ignore Rocket.Chat livechat channels/messages. It was
implemented in #20195.

This commit documents the caveat.
2024-08-14 18:18:31 -07:00