Commit Graph

60061 Commits

Author SHA1 Message Date
Tim Abbott 1716818c07 version: Update version after 9.2 release. 2024-09-12 15:26:05 -07:00
Tim Abbott 410bb468ec Release Zulip Server 9.2. 2024-09-12 13:57:11 -07:00
Tim Abbott aa47696191 i18n: Update translation data from Transifex. 2024-09-12 10:40:52 -07:00
Anders Kaseorg 93f64b5f3e requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 2a14a08e63)
2024-09-11 14:16:55 -07:00
Anders Kaseorg 5e93df8802 ruff: Fix PLR1714 Consider merging multiple comparisons.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit ea60bc3ff8)
2024-09-11 14:16:55 -07:00
Anders Kaseorg 19c3476f5b ruff: Fix E721 Use `isinstance()` for isinstance checks.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 05e54a0af2)
2024-09-11 14:16:55 -07:00
Mateusz Mandera 533a6cb1c6 auth: Update AzureADAuthBackend to use the newer Microsoft API.
As detailed in the comment in the code:

The upstream implementation uses the outdated /oauth2/authorize
API (instead of the v2.0 API), which doesn't allow us to authenticate
users with just a personal Microsoft account. v2.0 API is required.
This requires us to override the default URLs to use it as well
as adjust the requested scopes, to match this new API.

The backend in its previous state was only able to authenticate users
that were tied to an organizational directory, even if the application
settings in Azure were set up to also allow personal accounts. Users
trying to use a personal account would face an error from Microsoft:

AADSTS500200: User account 'xxxx@example.com' is a
personal Microsoft account. Personal Microsoft accounts are not
supported for this application unless explicitly invited to an
organization

https://github.com/python-social-auth/social-core/issues/723 is a
related upstream issue.

(cherry picked from commit 2a1da859ea)
2024-09-11 11:44:16 -07:00
Alex Vandiver da404d71a4 mattermost: Handle duplicate dm-groups.
Observed in the wild, cause unknown.

Partially fixes: #24131.

Co-authored-by: Mateusz Mandera <mateusz.mandera@zulip.com>
(cherry picked from commit c8c480baef)
2024-09-11 11:44:16 -07:00
roanster007 c987acbc06 refactor: Rename `huddle` to `direct_message_group` in non api files.
This commit completes rename of "huddle" to "direct_message_group"
in all the non API files.

Part of #28640

(cherry picked from commit 7b3e163d55)
2024-09-11 11:44:16 -07:00
Alex Vandiver 94ff57a4d9 thumbnail: Put the original dimensions on spinner images.
This lets us reserve the right amount of space in the message feed
immediately.

(cherry picked from commit 8bacdbc895)
2024-09-11 11:04:31 -07:00
Karl Stolley c27f09f7c8 message_controls: Add missing class to edit buttons.
(cherry picked from commit 82b0732b11)
2024-09-11 11:04:31 -07:00
Karl Stolley 4ec36eab8a message_controls: Explicitly select .message_control_button.
(cherry picked from commit 75a20f98d0)
2024-09-11 11:04:31 -07:00
Karl Stolley 96145ced7b message_controls: Add explicit message-controls-icon class.
(cherry picked from commit 6bc7b617d8)
2024-09-11 11:04:31 -07:00
Karl Stolley 8b4d448a0c message_row: Move message_controls into proper place in row file.
(cherry picked from commit aa83b1b5cd)
2024-09-11 11:04:31 -07:00
Karl Stolley f2bb6f7f01 compose: Specify non-alpha message-area colors.
This keeps colors uniform between edit and preview modes, and also
ensures no bleedthrough of the editor when in preview mode.

ID selectors have been used for those colors to both keep the text
color declaration in the same place, and to avoid a dark-theme
specificity problem where the generic textarea took precedence over
the colors specified on the compose box's own textarea.

(cherry picked from commit 2f726b20ed)
2024-09-11 11:04:31 -07:00
Karl Stolley 459f2ad7fd rendered_markdown: Remove expensive :first-child and :last-child selectors.
With the refactoring of the rendered-Markdown area to use only
margin bottom, including in message-edit previewsk, these expensive,
general selectors are unnecessary.

Headings and horizontal rules, which do have margin-top, are zeroed
out elsewhere in the rendered-markdown file.

(cherry picked from commit 887e7e1e13)
2024-09-11 11:04:31 -07:00
Karl Stolley 8ca34e856e message_preview: Set preview height based on edit area.
This ensures that neither the compose box nor the edit-message area
shifts when toggling back and forth between edit and preview modes.

(cherry picked from commit cc1cfa9336)
2024-09-11 11:04:31 -07:00
Karl Stolley 67e1813acf message_preview: Don't needlessly show/hide compose textarea.
Because the compose-box resize logic is tied to the size of the
textarea, it's possible when resizing in preview mode that the
state of the compose box is not properly tracked. That's because
the height logic in `autosize_message_content` assumes a visible
textarea.

However, because both the textarea and the message preview area
occupy the same named grid area (`message-content`), and because
the preview area comes after the textarea in the DOM, when visible,
the preview area will automatically cover (and be sized to) the
textarea. And because the textarea remains observable in the DOM,
the compose box will obey the same expansion logic in preview mode
as it does in edit mode.

(cherry picked from commit df04c4c1f9)
2024-09-11 11:04:31 -07:00
Alex Vandiver d2b3e02707 users: Soften assumptions that all bots have owners.
Imported Slack bots currently do not have owners (#23145).  Soften the
deactivation codepath to allow them to be successfully deactivated
despite this.

Co-authored-by: Mateusz Mandera <mateusz.mandera@zulip.com>
(cherry picked from commit 989d425023)
2024-09-11 11:04:31 -07:00
Mateusz Mandera acfe06d59f test_bots: Remove misleading comment.
This comment looks like an ancient leftover from early days (moved here
in a test_bots extraction in 123b4c1877 in
2017). Whatever its history, this comment and test name don't make sense
anymore. The response here is an error, not a silent success.

(cherry picked from commit 7ebeffbcdc)
2024-09-11 11:04:31 -07:00
Anders Kaseorg 29fdaa2f8d apt-repos: Use PGroonga binaries on Ubuntu 24.04.
These did not exist when we first added Ubuntu 24.04 support; now they
do.  Fixes #31261.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 8b147d92a8)
2024-09-11 11:04:31 -07:00
Karl Stolley 244d9ef545 message_row: Allow moved/edit markers to scale.
(cherry picked from commit 35f84e5381)
2024-09-11 11:04:31 -07:00
Shubham Padia 8aacfcdfee css: Use a class for spoiler header text.
Having the :not() rule there affected the performance, see
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1920156
for more details.

(cherry picked from commit 4a7983fad3)
2024-09-11 11:04:31 -07:00
Alex Vandiver 2ce934ed43 install: Update postgresql.version comment to be more accurate.
(cherry picked from commit 2eb5bcbcc9)
2024-09-11 11:04:31 -07:00
Alex Vandiver 54e221564b install: We need postgresql.version with zulip::postgresql_client too.
5308fbdeac split out `zulip::postgresql_client`, and 80ef38757a
made it no longer depend on `zulip::postgresql_common`, but directly
on `zulipconf('postgresql', 'version', undef)`.  However, the
installer depended on recognizing `zulip::postgresql_common` in the
list of pulled-in classes to know that we needed to keep the
`postgresql.version` setting in `/etc/zulip.conf`.

Update the installer to also recognize `zulip::postgresql_client` as a
class which tells us to keep `postgresql.version` in our settings.

(cherry picked from commit 22300373d3)
2024-09-11 11:04:31 -07:00
Anders Kaseorg 1c05d19c3e thumbnail: Fix corrupted email notifications due to HTML5 entities.
BeautifulSoup with formatter="html5" unnecessarily escapes many
characters with HTML5-specific entities that cannot be correctly
parsed by lxml during generation of email notifications.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e3abd09e67)
2024-09-11 11:04:31 -07:00
Alex Vandiver e827b2acf8 puppet: Make restart-server cron use standard day-of-week.
Using 7 makes this fail when run under the Sentry cron wrapper.

(cherry picked from commit 9497f23307)
2024-09-11 11:04:31 -07:00
Aman Agrawal aeec61476c typeahead: Fix compose topic typeahead partially hidden.
The `flip` popper function is not working properly here since
we migrated to use Simplebar (Can be verified by removing
`data-simplebar`).

To fix it, we need to force trigger the function as soon as tippy
is attached to DOM.

(cherry picked from commit 240c870815)
2024-09-11 11:04:31 -07:00
Alex Vandiver b10b412bd8 thumbnail: Enqueue thumbnails when we render a spinner.
Thumbnails are usually enqueued in the worker when the image is
uploaded.  However, for images which were uploaded before the
existence of the thumbnailing worker, and whose metadata was
backfilled (see previous commit) this leaves a permanent spinner,
since nothing triggers the thumbnail worker for them.

Enqueue a thumbnail worker for every spinner which we render into
Markdown.  This ensures that _something_ is attempting to resolve the
spinner which the user sees.  In the case of freshly-uploaded images
which are still in the queue, this results in a duplicate entry in the
thumbnailing queue -- this is harmless, since the worker determines
that all of the thumbnails we need have already been generated, and it
does no further work.  However, in the case of historical uploads, it
properly kicks off the thumbnailing process and results in a
subsequent message update to include the freshly-generated thumbnail.

While specifically useful for backfilled uploads, this is also
generally a good safety step for a good user experience, as it also
prevents dropped events in the queue from unknown causes from leaving
perpetual spinners in the message feed.

Because `get_user_upload_previews` is potentially called twice for
every message with spinners (see 6f20c15ae9), we add an additional
flag to `get_user_upload_previews` to suppress a _second_ event from
being enqueued for every spinner generated.

(cherry picked from commit 0c07c6531c)
2024-09-09 15:16:28 -07:00
Alex Vandiver c3c2933362 thumbnail: Backfill ImageAttachment rows.
We previously used the file extension to determine if we should
attempt to inline an image.  After b42863be4b, we rely on the
existence of ImageAttachment rows to determine if something is an
image which can be viewed inline.  This means that messages
containing files uploaded before that commit, when (re-)rendered, will
be judged as not having inline'able images.

Backfill all of the ImageAttachment rows for image-like file
extensions.  We are careful to only download the bytes that we need in
the image headers, to minimize bandwidth from S3 in the event that the
S3 backend is in use.  We do _not_ produce thumbnails for the images
during this migration; see the subsequent commit.

Because this migration will be backported to 9.x, it is marked as only
depending on the last migration in `9.x`, with a subsequent merge
migration into the tip of `main`.

(cherry picked from commit df91cdf333)
2024-09-09 15:16:28 -07:00
Tim Abbott a940c91e2d css: Explode dark theme disabled rule.
This replaces a :disabled selector with individual ones for each
element type; I verified in CSS selector profiling that this change
removes lines that were previously about 10% of profiled CSS selector
processing time for rendering the combined feed.

The reason being that the rendered elements have very few disable-able
elements, but the browser was spending a lot of time trying to match
**every** element for whether it might have been disabled, which was
slow.

This probably reflects a browser bug.

(cherry picked from commit e4567e05ac)
2024-08-29 10:45:39 -07:00
Mateusz Mandera 9c4d573da3 presence: Remove the queue worker.
(cherry picked from commit aaca394813)
2024-08-29 10:45:39 -07:00
Shubham Padia 8f65150a0f css: Remove unnecessary rule for subscriptions_overlay.
Even though the border-color was set for `#subscriptions_overlay
.subsection-parent div`, since the border-style was not set. It did not
have any effect on the appearance of the children div of
.subsection-parent.

(cherry picked from commit a746a7e784)
2024-08-29 10:45:39 -07:00
Shubham Padia e3189860ec css: Use padding-top instead of putting margin-top on first div.
It has the same visual effect and we do not have to use a div selector.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.

(cherry picked from commit 2081fb52a1)
2024-08-29 10:45:39 -07:00
Shubham Padia 4d9c1cda55 css: Use classname instead of div for .flex.overlay-content.
Each child div for .flex.overlay-content has the class
.overlay-container, so it is safe to replace the div with that
classname.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.

(cherry picked from commit 0d95d79033)
2024-08-29 10:45:39 -07:00
Shubham Padia f72f834c96 css: Use classname instead of `div` selector for .blocks.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.

(cherry picked from commit 8b96aa277a)
2024-08-29 10:45:39 -07:00
Shubham Padia e5f84647ba css: Use flexbox for .stream-row and .group-row.
Before this, we were having each direct child div for both the classes
as inline blocks. It is better to just have `display: flex` on the
parent element instead. There is a slight change in appearance which has
been confirmed in
https://chat.zulip.org/#narrow/stream/6-frontend/topic/Subscription.20list.20slight.20look.20change/near/1906254

(cherry picked from commit e9d0e1d30d)
2024-08-29 10:45:39 -07:00
Shubham Padia d168ac06ec css: Remove unused css for top-bar & bottom-bar for subscriptions.css.
These were added in ae7fe85ec5, and
should have been deleted in 333b8b095c.

Having those rules did not make any difference to the subscription and
user group list items.

(cherry picked from commit b619fbb7a7)
2024-08-29 10:45:39 -07:00
Shubham Padia dfafec3263 css: Use classname for .thanks-page instead of div.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.

(cherry picked from commit 52240e09ff)
2024-08-29 10:45:39 -07:00
Shubham Padia 80e6d0e2bc rendered_markdown: Remove unused .data-container div css.
Having that css there or not did not make any visual difference.

(cherry picked from commit a48ce954aa)
2024-08-29 10:45:39 -07:00
Shubham Padia 7ec93b920c css: Use class_name for .client-logos div.
Having the `div` selector there affects the performance. See
https://chat.zulip.org/#narrow/stream/6-frontend/topic/CSS.20selector.20performance/near/1845719
for more details.
We've introduced a new class called `.client-logos-div`.
In `hello.ts` we just manually append the name of this new class for the
logo changing logic since that felt more readable than adding the class
programmatically.

(cherry picked from commit 996a091bd9)
2024-08-29 10:45:39 -07:00
Shubham Padia 614dca46b4 app_components: Remove unused div selector css.
Having the styling there or not did not make any difference visually to
either of the drafts, scheduled messages or edit history overlays.

(cherry picked from commit f0e484ea07)
2024-08-29 10:45:39 -07:00
Karl Stolley d55b61e7be streams_settings: Removed unused FontAwesome references.
(cherry picked from commit da7114918f)
2024-08-29 10:45:39 -07:00
Aman Agrawal 70f2435bbc 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.

(cherry picked from commit aac75f87f9)
2024-08-29 10:45:39 -07:00
Tim Abbott 9cb7812459 node tests: Improve documentation for message_list_view test.
(cherry picked from commit 8c6d61f4a6)
2024-08-29 10:45:39 -07:00
evykassirer c5bce5c59a 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

(cherry picked from commit 9b78cc3240)
2024-08-29 10:45:39 -07:00
evykassirer 521c739a93 message_list_view: Add test helper to calculate move ranges.
(cherry picked from commit 5607d840e5)
2024-08-29 10:45:39 -07:00
evykassirer 050eda566c css: Use classname for topic visibility tooltip instead of span.
(cherry picked from commit 12207407c9)
2024-08-29 10:45:39 -07:00
evykassirer df5b23ece2 settings css: Use selector for empty option text instead of span.
(cherry picked from commit a243191539)
2024-08-29 10:45:39 -07:00
evykassirer dd3aeb9478 portico css: Use classname for header text instead of span.
(cherry picked from commit e0b0a3638e)
2024-08-29 10:45:39 -07:00