Commit Graph

58143 Commits

Author SHA1 Message Date
ae21f232a1 Build(deps-dev): Bump @swc/core from 1.10.18 to 1.11.1 (#31513)
Bumps [@swc/core](https://github.com/swc-project/swc) from 1.10.18 to
1.11.1.
- [Release notes](https://github.com/swc-project/swc/releases)
- [Changelog](https://github.com/swc-project/swc/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/swc-project/swc/compare/v1.10.18...v1.11.1)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-02-25 23:02:25 +01:00
0123345f06 Build(deps): Bump oj from 3.16.9 to 3.16.10 (#31511)
Bumps [oj](https://github.com/ohler55/oj) from 3.16.9 to 3.16.10.
- [Release notes](https://github.com/ohler55/oj/releases)
- [Changelog](https://github.com/ohler55/oj/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/ohler55/oj/compare/v3.16.9...v3.16.10)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 22:43:18 +01:00
dae4f170c2 Build(deps-dev): Bump rubocop-ast from 1.38.0 to 1.38.1 (#31510)
Bumps [rubocop-ast](https://github.com/rubocop/rubocop-ast) from 1.38.0
to 1.38.1.
- [Release notes](https://github.com/rubocop/rubocop-ast/releases)
-
[Changelog](https://github.com/rubocop/rubocop-ast/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-ast/compare/v1.38.0...v1.38.1)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-25 22:43:09 +01:00
26b0428837 FIX: exclude links from hidden posts in user summary (#31504)
Ref - https://meta.discourse.org/t/-/353878
2025-02-25 12:56:16 -05:00
74374e21a8 DEV: Add correct-scroll-position behavior transformer (#31486)
Add `correct-scroll-position` behavior transformer
2025-02-25 11:16:10 -06:00
f498c3b3e8 FIX: do not add _pm suffix to locale key when email is from system user (#31505)
See
https://meta.discourse.org/t/email-footer-says-visit-message-to-respond-to-no-names-after-to/354359

There may be a deeper root issue somewhere further up the stack, but
this change ensures we always use the `visit_link_to_respond` locale key
when the PM is from `system`. Seems cleaner than copy that says `to
respond to system`.

Before

![CleanShot 2025-02-25 at 10 38
44@2x](https://github.com/user-attachments/assets/ef12a957-72f7-418e-a109-448384e32def)

After

![CleanShot 2025-02-25 at 10 38
25@2x](https://github.com/user-attachments/assets/d8359812-63c5-444a-b36a-75a2e0bcfbb0)
2025-02-25 11:37:52 -05:00
1d7663d63c FEATURE: Allow chat incoming webhooks to work without .json extension (#31497)
This provides a slightly nicer-looking URL, and also helps when external
systems have strict validations on the webhook URL.
2025-02-25 15:04:57 +00:00
61d8cce569 Update translations (#31501) 2025-02-25 15:11:27 +01:00
3d5a1858e5 FIX: exclude bots of inaccessible/unreachable mentions (#31458)
It will prevent to show a notice saying the bot is not part of the
channel.

---------

Co-authored-by: Martin Brennan <mjrbrennan@gmail.com>
2025-02-25 10:19:51 +01:00
3a8e078116 FIX: Use []() Markdown syntax for links instead of <> for narrative bot (#31496)
In one of the discourse narrative bot tutorial steps, we show the user a
few links and ask them to copy one and paste it in a reply to teach them
about oneboxes. In order to prevent the links from getting oneboxed in
the bot's post, we enclose them in `<>` which makes the links render
as-is without oneboxing.

However, if an admin attempts to customize via site texts the tutorial
step about onebox, the links enclosed in `<>` get removed completely
from the step content because they're interpreted as HTML tags when the
text override goes through sanitization (see [relevant
code](424da95128/app/models/translation_override.rb (L73-L74))).

To prevent that, this commit changes the default content for the onebox step
to use the `[]()` syntax which doesn't get sanitized and also doesn't
get oneboxed.

Internal topic: t/147912.
2025-02-25 11:51:15 +03:00
8cacb9800d DEV: Remove deprecated AuthProvider attributes (#31443)
A number of attributes on AuthProvider are deprecated for and were marked for removal in 2.9.0.

This PR removes them.
2025-02-25 16:40:35 +08:00
424da95128 DEV: Fix username/name mapping for Discord auth (#31494)
Previously we were applying the Discord username to both the name and
the username fields in Discourse.

Supersedes https://github.com/discourse/discourse/pull/30994
2025-02-25 17:33:26 +11:00
209d289772 FIX: No method error in WebhooksController#sendgrid (#31495)
When an email is sent by sendgrid to an email address with an invalid
host, the webhook payload does not contain the "status" field:

```
[
  {
    "bounce_classification": "Unclassified",
    "email": "noemail@this.does.not.exist.tld",
    "event": "bounce",
    "reason": "unable to get mx info: failed to get IPs from PTR record: lookup <nil>: unrecognized address",
    "sg_event_id": "Ym91bmNlLTQtNTA0ODUxOTUtZXVvMmlLeGRTYXlQRjRZRTQtLUk3QS0w",
    "sg_message_id": "euo2iKxdSayPF4YE4--I7A.recvd-5f54b5d587-pczjm-1-67BADEEA-6.0",
    "smtp-id": "<870b3a2a-160c-4fc8-bc9a-bd0d5b943b81@forum.umbraco.com>",
    "timestamp": 1740300320,
    "tls": 0,
    "type": "blocked"
  }
]
```

When the `status` field is missing, it results in a `NoMethodError
(undefined method `[]' for nil:NilClass)`
error in the controller method. In this commit, we will specifically
handle the webhook event from sendgrid when the email address's domain
is invalid.

Co-Authored-By: @nul800sebastiaan
2025-02-25 13:08:59 +08:00
b02e87b8c4 DEV: Introduce ColorPaletteEditor component (#31328)
As part of the theme/color palette overhaul project, we're redesigning
the UI for the editing color palettes. This commit introduces a new
`ColorPaletteEditor` component that encapsulates all the logic and
interface for editing color palettes in the redesigned admin interface.
This component isn't used anywhere at this moment, but it will be once
we start introducing the rest of the redesigned interface.
2025-02-25 07:58:04 +03:00
f1a892a64e FIX: include silence_reason when admin sees user (#31493)
Small regression created in this PR
https://github.com/discourse/discourse/pull/30635

The reason is included only when `include_silence_reason` option is
included.
2025-02-25 14:14:33 +11:00
f591083407 PERF: Set cluster_concurrency for Jobs::UpdateUsername to 1 (#31492)
This optimization is similar to the optimization applied in
eb603b246bad6df964b179a047a63e2b7894be8a. As part of the
`UserAnonymizer#make_anonymous` method call, the `Jobs::UpdateUsername`
sidekiq job is enqueued and this job runs many expensive and hard to
optimize SQL queries. Hence, we are restricting the
`cluster_concurrency` for
the sidekiq job to `1` to prevent the database from being overloaded in
the event that many users are being anonymized in a short period of
time.
2025-02-25 10:47:51 +08:00
4eed96f511 FIX: Discobot onebox step sometimes not working (#31472)
This issue was found via Discobot. In part of the tutorial
for Discobot, it asks for a URL on one line so it can demonstrate
how oneboxes work.

The way it does this when the user replies is to cook the
post raw and check if there is a cached onebox for the URL
in the post. However, if you reply really fast to Discobot
with the URL without waiting for the onebox to appear in the
composer preview, it's not cached by the time we do this
check in the Discobot code.

This commit fixes the issue by following a more simplified
approach, where we check for the existence of one of the
following links from the onebox instructions:

```
https://en.wikipedia.org/wiki/Inherently_funny_word
https://en.wikipedia.org/wiki/Death_by_coconut
https://en.wikipedia.org/wiki/Calculator_spelling
```

This will fall down if someone customizes the onebox
step text, or if the user uses a different link instead,
but we are willing to accept that risk at this time to simplify things.
2025-02-25 12:41:37 +10:00
ae5ad250f6 DEV: Extract out html cleanup so it can be used on other types of cooked content (#31385)
`PrettyText.cook` does two things: 1️⃣ convert raw to cooked, 2️⃣
partial sanitisation.

This commit splits the 2️⃣ up so that it can be applied to other cooked
content.
2025-02-25 10:36:36 +08:00
d4e5d63d7e DEV: Fix command error message formatting (#31491)
a follow up to 51b0903f514c3c22569401e74ebd1215c317d787
2025-02-25 02:28:01 +01:00
51b0903f51 DEV: Add command to execute_command errors (#31490) 2025-02-25 00:49:11 +01:00
3d2a6322d0 DEV: Update lint-configs and auto-fix issues (#31485) 2025-02-24 23:32:31 +01:00
2561f4f431 Build(deps-dev): Bump puppeteer-core from 24.2.1 to 24.3.0 (#31487)
Bumps [puppeteer-core](https://github.com/puppeteer/puppeteer) from
24.2.1 to 24.3.0.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
-
[Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v24.2.1...puppeteer-core-v24.3.0)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-02-24 23:21:06 +01:00
109fc428d8 DEV: Clear extra-locales cache between tests (#31488) 2025-02-24 22:10:43 +00:00
db3db9fe41 DEV: Log site setting changes from the rails console (#31353)
When using the rails console to change site settings log them to the
staff actions logs so that there is a record.
2025-02-24 14:57:01 -07:00
f744852f10 Build(deps-dev): Bump rubocop-rails from 2.30.1 to 2.30.2 (#31484)
Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from
2.30.1 to 2.30.2.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
-
[Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/rubocop/rubocop-rails/compare/v2.30.1...v2.30.2)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 22:27:03 +01:00
7b6284d6f2 Build(deps): Bump version_gem from 1.1.5 to 1.1.6 (#31483)
Bumps [version_gem](https://gitlab.com/oauth-xx/version_gem) from 1.1.5
to 1.1.6.
-
[Changelog](https://gitlab.com/oauth-xx/version_gem/blob/1.1-stable/CHANGELOG.md)
-
[Commits](https://gitlab.com/oauth-xx/version_gem/compare/v1.1.5...v1.1.6)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 22:26:54 +01:00
7e37aa007f Build(deps): Bump excon from 1.2.3 to 1.2.4 (#31482)
Bumps [excon](https://github.com/excon/excon) from 1.2.3 to 1.2.4.
- [Changelog](https://github.com/excon/excon/blob/master/changelog.txt)
- [Commits](https://github.com/excon/excon/compare/v1.2.3...v1.2.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 22:26:44 +01:00
795413e6fd FIX: Falls back to username if name is empty (#31481)
Quick fix after https://github.com/discourse/discourse/pull/31292

Ensures if a user's name field is empty that it will fall back to
username.
2025-02-24 14:04:39 -06:00
1f5cce705c FIX: Include locale in extra-locales URLs (#31480)
Previously the rendered locale was based on the current session's
locale. Now that we're routing requests via the CDN, we can't rely on
the user's session, and should instead include the locale name in the
URL. Also adds a `.js` suffix for parity with our other JS assets.
2025-02-24 17:20:46 +00:00
2062e4eb90 2FA Backup Code Download: Use CRLF for Windows-compatibility (#29400)
Currently LF is used, making the backup codes indistinguishable for Windows users. 

Instead, use CRLF which is compatible for Windows as well as Linux and macOS.

https://meta.discourse.org/t/-/331940
2025-02-24 16:32:57 +01:00
12291f745c PERF: Move extra-locale digest from query-param to path (#31479)
CDNs are often configured to strip query params, which means that the
`?v=` parameter wasn't reaching the Rails app, and therefore the
cache-control header was not being set correctly. Having a 40 character
sha1 digest in the **path** is the approach we take for other similar
assets like stylesheets and theme-javascripts.

Also adds a spec for the fix in 573fbeef64f052decc47e740cbe01a3c298c20b5
2025-02-24 14:09:15 +00:00
44aa0eda27 UX: add automation script description for pm sender (#31478)
Adds a description to highlight the need for sender to have correct
permissions when sending PM. Without the correct permissions the PM is
not sent and a message is added to the site logs.
2025-02-24 15:54:41 +04:00
573fbeef64 FIX: Include hostname in extra-locales URLs (#31477)
Followup to 1b5e4b6b0fef9811839490f2ee3b9f31d5fbed3b

When running through a CDN in a multisite environment, the site hostname
needs to be included in the path or query or the URL so that the
'current db' can be set correctly by rails multisite. Without this, the
response will assume the default site in the cluster.
2025-02-24 10:55:37 +00:00
342ab6f082 FIX: delayed chat summary email (#31255)
Updates the chat summary email to account for:

- unread mentions in category channels (same as before)
- unread direct messages (now excluding threads)
- unread watched thread replies (for both channels and DM channels)

We have also reduced the window from 1 week down to 1 day for all 3
criteria. The DM unreads query is now properly selecting the first
unread message within the window (rather than the first message
regardless of read status).
2025-02-24 14:25:52 +04:00
18c8a8ffca UX: Fix flags config page translations (#31476)
Followup e26a1175d7c33746bddbc858ad89e68cc14beefe


![image](https://github.com/user-attachments/assets/7228be1c-e3fc-4261-95a8-2fbb96b776bb)
2025-02-24 16:29:53 +10:00
0289054126 FIX: Ensures multi-like notifs respect prioritize_full_name_in_ux setting (#31292)
Some loose ends from the addition of the `prioritize_full_name_in_ux`
site setting. Singular Like works as expected, but not the consolidated
notifs.

This [core PR](https://github.com/discourse/discourse/pull/31346) is
connected to this.

Before (with site setting on):
<img width="354" alt="Screenshot 2025-02-17 at 3 55 17 PM"
src="https://github.com/user-attachments/assets/3c2b37d9-201d-481f-8fc3-4bf7aa17941c"
/>

After (with site setting on):
<img width="293" alt="Screenshot 2025-02-17 at 3 55 07 PM"
src="https://github.com/user-attachments/assets/230c9f4c-c9fc-4151-a8d7-add1b3625eae"
/>
2025-02-24 16:52:21 +11:00
6284ec9933 Bump version to v3.5.0.beta2-dev 2025-02-24 12:55:00 +08:00
4441274456 Bump version to v3.5.0.beta1 v3.5.0.beta1 2025-02-24 12:54:59 +08:00
122e1384bc Update translations (#31470) 2025-02-24 15:11:55 +11:00
0a2591280f Build(deps): Bump version_gem from 1.1.4 to 1.1.5 (#31462)
Bumps [version_gem](https://gitlab.com/oauth-xx/version_gem) from 1.1.4
to 1.1.5.
-
[Changelog](https://gitlab.com/oauth-xx/version_gem/blob/1.1-stable/CHANGELOG.md)
-
[Commits](https://gitlab.com/oauth-xx/version_gem/compare/v1.1.4...v1.1.5)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-24 09:28:26 +08:00
d50bba3bdc DEV: Allow SiteSetting::Update service to bulk update (#31438)
Previously, the SiteSetting::Update service allowed to update of a
single site setting. In the About controller, we were using the loop
through all settings -
https://github.com/discourse/discourse/blob/main/app/controllers/admin/config/about_controller.rb#L39

It is suboptimal because if the 3 first settings are saved and the
fourth is invalid, we will end with partially updated data.

Changing SiteSetting::Update to accept hash means that we will check
upfront if none of the settings are hidden or invalid and update all or
none.

Custom policies are used to report which settings are failing.
2025-02-24 11:09:44 +11:00
6e72f4efe4 Build(deps-dev): Bump the embroider group with 3 updates (#31463)
Bumps the embroider group with 3 updates:
[@embroider/compat](https://github.com/embroider-build/embroider/tree/HEAD/packages/compat),
[@embroider/core](https://github.com/embroider-build/embroider/tree/HEAD/packages/core)
and
[@embroider/webpack](https://github.com/embroider-build/embroider/tree/HEAD/packages/webpack).


Updates `@embroider/compat` from 3.8.2 to 3.8.3
- [Release notes](https://github.com/embroider-build/embroider/releases)
-
[Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/compat)

Updates `@embroider/core` from 3.5.1 to 3.5.2
- [Release notes](https://github.com/embroider-build/embroider/releases)
-
[Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/core)

Updates `@embroider/webpack` from 4.0.10 to 4.1.0
- [Release notes](https://github.com/embroider-build/embroider/releases)
-
[Changelog](https://github.com/embroider-build/embroider/blob/main/CHANGELOG.md)
-
[Commits](https://github.com/embroider-build/embroider/commits/HEAD/packages/webpack)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Discourse CI <ci@ci.invalid>
2025-02-23 23:59:49 +01:00
88bdfcd657 Build(deps): Bump ace-builds from 1.38.0 to 1.39.0 (#31465)
Bumps [ace-builds](https://github.com/ajaxorg/ace-builds) from 1.38.0 to
1.39.0.
- [Release notes](https://github.com/ajaxorg/ace-builds/releases)
-
[Changelog](https://github.com/ajaxorg/ace-builds/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/ajaxorg/ace-builds/compare/v1.38.0...v1.39.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-23 23:20:04 +01:00
3e5d423919 Build(deps-dev): Bump jsuites from 5.9.0 to 5.9.1 (#31464)
Bumps [jsuites](https://github.com/jsuites/jsuites) from 5.9.0 to 5.9.1.
- [Release notes](https://github.com/jsuites/jsuites/releases)
-
[Changelog](https://github.com/jsuites/jsuites/blob/master/changelog.md)
- [Commits](https://github.com/jsuites/jsuites/commits)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-23 23:19:33 +01:00
618be71d92 Build(deps-dev): Bump lefthook from 1.10.10 to 1.11.0 (#31467)
Bumps [lefthook](https://github.com/evilmartians/lefthook) from 1.10.10
to 1.11.0.
- [Release notes](https://github.com/evilmartians/lefthook/releases)
-
[Changelog](https://github.com/evilmartians/lefthook/blob/master/CHANGELOG.md)
-
[Commits](https://github.com/evilmartians/lefthook/compare/v1.10.10...v1.11.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-23 23:18:17 +01:00
93e2d34598 Build(deps-dev): Bump selenium-webdriver from 4.29.0 to 4.29.1 (#31461) 2025-02-23 22:48:02 +01:00
c592edbe34 DEV: Update discourse_dev_assets and faker (#31436) 2025-02-22 10:25:56 +01:00
59406fb286 DEV: Remove an obsolete gem (#31459) 2025-02-22 10:25:33 +01:00
cb257ff658 DEV: allows to add a draft without persisting it (#31457)
On chat setup we get the initial state of drafts for the current users,
we need to add them to the drafts manager, but we don't need to store
them again on the backend.

This commit adds a persist (boolean) parameter to the
`ChatDraftsManager.add` service which when set to true will only add the
draft on the frontend and not send it to the backend.

No test, as the behavior is already tested and unchanged, this is only a
performance improvement.
2025-02-22 01:29:12 +01:00
eb1ef04ed5 UX: Replace solid face-smile emoji picker icon with a regular one (#31421)
Before/After

<img width="101" alt="image"
src="https://github.com/user-attachments/assets/8cb670db-882b-43b2-b7e0-7306591f238a"
/> <img width="101" alt="image"
src="https://github.com/user-attachments/assets/6e0c9f6c-40ad-4914-ba71-7d0ef022bb76"
/>
2025-02-21 22:25:42 +01:00