Commit Graph

55801 Commits

Author SHA1 Message Date
Alex Vandiver a25ee8aad0 message_edit: len(changed_messages) is always > 0.
It is only ever added to, and starts as a one-element list.

(cherry picked from commit db3bcb8889)
2024-03-07 09:48:20 -08:00
Tim Abbott eeedc34e58 message_edit: Ensure gaining_usermessage_user_ids is set.
This makes this code path a bit easier to follow.

(cherry picked from commit 68be070306)
2024-03-07 09:48:20 -08:00
Tim Abbott e928fce232 message_edit: Clarify unmodified_user_messages logic.
(cherry picked from commit fc679b09a3)
2024-03-07 09:48:20 -08:00
Alex Vandiver fd1db72276 tests: Reserve "Internal" client, used by email gateway and topic moves.
(cherry picked from commit 13b9c87f93)
2024-03-07 09:48:20 -08:00
Alex Vandiver aee36b2b49 tests: Clear in-memory Client caches before testing query counts.
This makes counts more apples-to-apples comparable when run
back-to-back.

(cherry picked from commit a84de411a9)
2024-03-07 09:48:20 -08:00
Aman Agrawal c440958ecf personal_menu: Fix clicking on `Set status` not working.
Use `tabindex` instead of `href` to set focus on `a` tag.

Ideally, we should use `button` for these elements but since
we want to keep the pattern for these dropdowns same where some
`a` elements do have a valid `href`.

(cherry picked from commit 95e74558c5)
2024-03-01 09:26:25 -08:00
Aman Agrawal 0a97e41581 Revert "desktop_app: Close popover when clicking on "Plan management"."
This reverts commit 1f79e6294f.
No longer required after
70ba7cc042

(cherry picked from commit 569b2c8a60)
2024-03-01 09:26:25 -08:00
Aman Agrawal 2530566774 popover_menu: Fix popover not closed on clicking external links.
For example, gear menu was not closed after `Integrations` button
was clicked since we don't have an event handler which opens
`/integrations` in a new tab but we let the browser navigate user
to `/integrations` after clicking on `a href='/integrations'`.

There was no handler for hiding the popover after clicking on such
links, so this commit adds one.

(cherry picked from commit 70ba7cc042)
2024-03-01 09:26:25 -08:00
Lalit edeea66b0f ts: Migrate `popover_menus` to typescript.
This commit migrates `popover_menus` module to TypeScript. Also adds
a placeholder types declaration file for `css_variables` module.

(cherry picked from commit 02257b8cbf)
2024-03-01 09:26:25 -08:00
Tim Abbott 3e012889aa docs: Document restarts after changing zulip.conf.
(cherry picked from commit 7d9c82cbea)
2024-03-01 09:26:25 -08:00
David Rosa 32990b79e2 docs: Split /production/deployment.html into multiple pages.
- Makes "Deployment options" easier to navigate by splitting the
  "Reverse proxies" and "System configuration" sections out into
  dedicated pages.

Fixes #28928.

(cherry picked from commit 2b95068406)
2024-03-01 09:26:25 -08:00
Alya Abbott d65fa3bb47 docs: Move installation troubleshooting section to troubleshooting.md.
(cherry picked from commit 78aad5a4df)
2024-03-01 09:26:25 -08:00
Alya Abbott 9fa6f34770 docs: Move installer details to Deployment options page.
(cherry picked from commit 112f3d123a)
2024-03-01 09:26:25 -08:00
Alya Abbott de0688ff84 docs: Edit installation instructions for clarity.
(cherry picked from commit 7f51161761)
2024-03-01 09:26:25 -08:00
Alex Vandiver 0fe967b1c2 web: Fix links which were missing trailing slashes.
(cherry picked from commit eefe147c34)
2024-03-01 09:26:25 -08:00
sujal 8b1a62f36c setting_ui: Fix sorting by "Expires at" column.
Previously, the sorting was broken due to
incorrect referencing of the property.
The code has been updated to use the "expiry_date"
property instead of "expires_at".

Fixes #29005.

(cherry picked from commit bf464db61b)
2024-03-01 09:26:25 -08:00
Alex Vandiver 3c8796a2ad export_search: Support exporting DMs or huddles.
(cherry picked from commit 6b8365024c)
2024-03-01 09:26:25 -08:00
Karl Stolley 1b451d1958 left_sidebar: Remove padding from bot icon.
This is no longer necessary for vertical alignment, and by
removing the 6px of padding it represents, bot DM rows will have
the same 22px height as other DM rows.

(cherry picked from commit ea83b1f4de)
2024-03-01 09:26:25 -08:00
Karl Stolley fb9c47838d left_sidebar: Remove unnecessary padding on bot icon.
(cherry picked from commit 9887b00317)
2024-03-01 09:26:25 -08:00
Lauryn Menard 85bd8dd33d push-bouncer: Exclude LoggingCountStats with partial data.
LoggingCountStats with a daily duration and that are directly stored
on the RealmCount table (not via aggregation in process_count_stat),
can be in a state, after the hourly cron job to update analytics
counts, where the logged value will be live-updated later, because
the end time for the stat is still in the future.

As these logging counts are designed to be used on the self-hosted
installation for either debugging or rate limiting, sending these
partial/incomplete counts to the bouncer has low value.

(cherry picked from commit 40daf10a74)
2024-03-01 09:26:25 -08:00
Tim Abbott b4f95a54e1 puppeteer: Disable flaky administrative UI test.
(cherry picked from commit ea89a4c6f7)
2024-02-16 15:24:39 -08:00
Tim Abbott b4d26426aa version: Update version after 8.2 release. 2024-02-16 15:22:48 -08:00
Tim Abbott a9fa22965b Release Zulip Server 8.2. 2024-02-16 15:01:33 -08:00
Tim Abbott d2e95f282b i18n: Update translations from Transifex. 2024-02-16 14:44:11 -08:00
Sahil Batra f323aa9709 settings: Fix check_property_changed code for user access setting.
The proposed_val for "realm_can_access_all_users_group" setting
was always returning NaN value which resulted in the value
being included in request even when it was not changed or disabled
due to org not being on "Plus" plan. This resulted in a bug where
user was not allowed to change the "guest" indicator setting
on orgs without "Plus" plan.

For orgs with "Plus" plan there was no problem in changing the
setting but the save button was visible incorrectly if the setting
was set to the initial value.

This commit fixes both the bugs.

(cherry picked from commit 4a98eb205d)
2024-02-16 12:28:16 -08:00
Sahil Batra 727a1eeb1d admin: Remove unnecessary development_environment check.
The "Who can access all users" setting is not disabled for
organizations not on "Plus" plans in production because of
the "page_params.development_environment" check.

We do not need that check anymore as the feature is now
enabled in production.

(cherry picked from commit ae9ef830f0)
2024-02-16 12:28:16 -08:00
Tim Abbott 2064a9da12 web: Use better exponential backoff algorithm.
This matches the algorithm that we designed for the Python API, except
that we use a ratio of 2 rather than sqrt(2) in the message_fetch code
path, because it's a heavier request.

We increase the number of failures before showing a user-facing error
to roughly preserve the same time period before a user-facing error is
shown.

(cherry picked from commit b5b496c752)
2024-02-16 12:28:16 -08:00
Tim Abbott 47e228882c web: Respect rate-limiting headers in main APIs.
Previously, these endpoints just did exponential backoff, without
looking at the rate-limiting headers returned by the server, resulting
in requests that the client could have been certain would fail with an
additional rate-limiting error.

Fix this by using the maximum of the existing exponential backoff with
the value returned by the rate-limiting header.

Fixes #28807.

(cherry picked from commit e3960c22be)
2024-02-16 12:28:16 -08:00
Tim Abbott dbbf860fbb message_fetch: Add small backfill delay.
This should help reduce the risk of hitting rate limits when users
have a very large number of messages to fetch via this mechanism.

Inline the `messages` variable that was only used in one place while
we're touching this.

(cherry picked from commit 8f32ebe706)
2024-02-16 12:28:16 -08:00
Tim Abbott ae05d780c7 reload: Add on-focus handler after a delay.
(cherry picked from commit 9479eae87f)
2024-02-16 12:28:16 -08:00
Tim Abbott 187c9e4b14 util: Fix call_function_periodically.
This function incorrectly and misleadingly did an immediate initial
call, despite both of its callers doing immediate calls themselves (in
one case, with a different parameter passed).

This led to unnecessary server load when reloading the app via event
system triggered reloads, since every client would call `/` twice.

(cherry picked from commit 2c56978b02)
2024-02-16 12:28:16 -08:00
Aman Agrawal 2794c779da narrow: Fix message row partially visible on narrow.
This will prevent any message we want to select after narrowing
from being offscreen entirely or partially.

Steps to reproduce the bug:
* `./manage.py populate_db -n 3000 --max-topics=2`
* Narrow to a stream and scroll high up.
* Align two recipient bars together with nothing between them.
* Click on the first recipient bar after keeping the selected message
  on the second recipient bar.
* You will see that the selected message is not in view.

(cherry picked from commit 120ff78516)
2024-02-16 12:28:16 -08:00
Aman Agrawal 9b49909d3e compose_actions: Fix incorrect condition.
This was introduced in #28767 with the intention to skip scrolling
the selected message.

So, the actual bug that the PR fixed would have been just fixed
by opening the compose box early.

(cherry picked from commit aa76919ddb)
2024-02-16 12:28:16 -08:00
Tim Abbott c9eb942105 narrow: Clarify some confusing details.
The update_selection function name was rather misleading, since that
function call is in fact what renders the message list object for the
view.

Also add comments about a few subtle/confusing details that I noticed
while debugging this code path today.

(cherry picked from commit 61ff8f2bef)
2024-02-16 12:28:16 -08:00
Tim Abbott 8b8ab7fb9c narrow: Open compose box before rendering main message feed.
As discussed in the new comments, we had a bug where the
system-initiated animated scroll that happens when the compose box
opens as a result of narrowing would race with the internal
rerendering that occurs when the message_fetch request asking the
server for additional data returns.

The correct fix for this is just to open the compose box, if we're
going to do so, before setting the user's scroll position in the
narrowing/rendering process.

This ends up being a UI improvement (in that the compose box is
available for typing a bit earlier) as well as avoiding both the risk
of this race as well as the bad UX of adjusting the user's scroll
position multiple times as part of entering the view.

This does not address an as-yet-unknown bug wherein the animated
scroll that occurs when opening the compose box, when racing with a
background rerender, results in a bogus ending scroll position, though
it's easy to see how that might occur given that rerendering does
clear the DOM briefly.

(cherry picked from commit 4e2a282a1b)
2024-02-16 12:28:16 -08:00
Tim Abbott c4dfeb9c37 puppet: Increase minimum memory for multiprocess queue workers.
This should give some more room for systems that are still below 4GB
of RAM to use the lower-memory multithreaded mode, which is less
likely to have OOM kills (a very bad experience).

There should be little cost, as few systems are likely allocated with
memory in this range.

(cherry picked from commit a22f418827)
2024-02-16 12:28:16 -08:00
Tim Abbott 8ea5e2156a puppet: Update rules for number of uwsgi processes.
The defaults for how many uwsgi processes to run no longer depend on
the queue processor mode, but instead the total memory on the system.

(cherry picked from commit 62dbe2298e)
2024-02-16 12:28:16 -08:00
Alex Vandiver 3048ff35d8 requirements: Revert orjson upgrade due to segfault.
Version 3.9.11 and 3.9.12 are susceptible to random segfaults:
- https://github.com/ijl/orjson/issues/452

(cherry picked from commit 437361de32)
2024-02-16 12:17:34 -08:00
Anders Kaseorg 2e4785f51c requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 93198a19ed)
2024-02-16 12:17:34 -08:00
Anders Kaseorg 893c10f869 ruff: Fix DJ012 Order of model's inner classes, methods, and fields.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e56863fa85)
2024-02-16 12:17:34 -08:00
Anders Kaseorg 7b604d3cde ruff: Fix SIM300 Yoda conditions are discouraged.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit ab25ebd5ce)
2024-02-16 12:17:34 -08:00
Mateusz Mandera d977dfe6e9 push_notifs: Gracefully handle exception when server cant push.
The problem was that earlier this was just an uncaught JsonableError,
leading to a full traceback getting spammed to the admins.
The prior commit introduced a clear .code for this error on the bouncer
side, meaning the self-hosted server can now detect that and handle it
nicely, by just logging.error about it and also take the opportunity to
adjust the realm.push_notifications_... flags.

(cherry picked from commit e8018a7285)
2024-02-16 11:26:05 -08:00
Mateusz Mandera 0a1905ea8d zilencer: Improve json error when plan doesn't allow push notifs.
This allows the self-hosted server to explicitly test for that exception
and catch and log it nicely.

(cherry picked from commit 5b03932d5c)
2024-02-16 11:26:05 -08:00
Alex Vandiver 3d8b9af76d version: Update to point to 8.0 blog post. 2024-01-24 17:50:42 -08:00
Tim Abbott 9099355d11 version: Update version after 8.1 release. 2024-01-24 17:49:27 -08:00
Tim Abbott 93d74607ce Release Zulip Server 8.1. 2024-01-24 17:28:39 -08:00
Anders Kaseorg 6e09c01772 typeahead: Remove insecure default highlighter implementation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 16:46:02 -08:00
Anders Kaseorg bc5d4b565a settings_playgrounds: Fix HTML injection in language typeahead.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-01-24 16:46:02 -08:00
Sahil Batra 0df7bd71f3 CVE-2024-21630: Check permission to subscribe others using invite link.
This commit updates the API to check the permission to subscribe other
users while creating multi-use invites. The API will raise error if
the user passes the "stream_ids" parameter (even when it contains only
default streams) and the calling user does not have permission to
subscribe others to streams.

We did not add this before as we only allowed admins to create
multiuse invites, but now we have added a setting which can be used
to allow users with other roles as well to create multiuse invites.
2024-01-24 16:46:02 -08:00
Mateusz Mandera bfcde65449 docs: Add documentation for the new custom auth wrapper setting.
(cherry picked from commit 5c8d588b52)
2024-01-24 16:38:46 -08:00