Commit Graph

54335 Commits

Author SHA1 Message Date
Discourse Translator Bot 9d8044a2ee
FEATURE: Add Uyghur language (#27183)
Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
2024-05-27 09:58:18 +02:00
Gerhard Schlager 5e61d55940
FIX: Updating avatar didn't trigger a rebake of posts with quotes of the user (#27184) 2024-05-27 09:57:48 +02:00
Gerhard Schlager 9aede9c8d8
FIX: "Replace Text" didn't list "Welcome Topic" when "General" category is missing (#27182)
Replacing the text of seeded topics doesn't require categories to exist, so this change removes that requirement for updates.
2024-05-27 09:57:30 +02:00
Sam d1191b7f5f
FEATURE: topic_view_stats table with daily fidelity (#27197)
This gives us daily fidelity of topic view stats

New table stores a row per topic viewed per day tracking
anonymous and logged on views

We also have a new endpoint `/t/ID/views-stats.json` to get the statistics for the topic.
2024-05-27 15:25:32 +10:00
Alan Guo Xiang Tan 6cafe59c76
DEV: Add `DISCOURSE_DUMP_BACKTRACES_ON_UNICORN_WORKER_TIMEOUT` env (#27199)
This commit adds a `DISCOURSE_DUMP_BACKTRACES_ON_UNICORN_WORKER_TIMEOUT`
environment that will allow us to dump all backtraces for all threads of
a Unicorn worker 2 seconds before it times out. In development,
backtraces are dumped to `STDOUT` and in production we will dump it to
`unicorn.stdout.log`.

We want to dump all the backtraces to make it easier to identify the
cause of a Unicorn worker timing out.
2024-05-27 12:20:38 +08:00
Martin Brennan 3a91a92563
DEV: Remove hashtag deprecations (#27195)
Introduced in
c7860173c1,
they are no longer necessary once https://github.com/discourse/discourse-encrypt/pull/317
is merged
2024-05-27 14:00:36 +10:00
Ted Johansson cb592ae4ac
DEV: Remove deprecated User#saw_notification_id method (#27175) 2024-05-27 11:10:46 +08:00
Juan David Martínez Cubillos 581dbca97f
DEV: Update Reviewables agree and edit action test (#27162) 2024-05-24 12:20:30 -07:00
Joffrey JAFFEUX 0260415664
FIX: correctly handle notifications for channels (#27178)
Prior to this fix we had too logic to detect if a user is active or not:

- idle codepath on the frontend
- online user ids on the backend

The frontend solution is not very reliable, and both solution are just trying to be too smart. Making a lot of people questioning why they receive a notification sometimes and sometimes not. This commit removes all this logic and replaces it with a much more simpler logic:

- you can't receive notifications for channel you are actually watching
- we won't play a sound more than once every 3seconds
2024-05-24 19:59:24 +02:00
Joffrey JAFFEUX 14b8894ddb
FIX: missing appEvents param for onNotification (#27180)
The `onNotification` signature is:

```
onNotification(data, siteSettings, user, appEvents)
```

And we were not passing `appEvents`.

Also explicitly inject `currentUser` in `chat-notification-manager` service.
2024-05-24 18:39:54 +02:00
Régis Hanol bc089dc52b FIX: bypass fast edit when selected text isn't editable
When selected some text inside a post, we offer the ability to "fast edit" the selected text without opening the composer.

However, there are certain cases where this isn't working quite a expected, due to the fact that we have some text in the "cooked" version of the post that isn't literally in the "raw" version of the post.

This ensures that whenever someone selects the within

- a quote
- a onebox
- an encrypted message
- a "cooked" date

we directly show the composer instead of showing the fast edit modal and then leaving the user with an invisible error.

Internal ref. t/128400
2024-05-24 18:19:28 +02:00
dependabot[bot] a658465b7d
Build(deps): Bump racc from 1.7.3 to 1.8.0 (#27119)
updated-dependencies:
- dependency-name: racc
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 18:05:37 +02:00
dependabot[bot] 414086e9a5
Build(deps-dev): Bump glob from 10.3.15 to 10.3.16 (#27121)
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 18:05:18 +02:00
Joffrey JAFFEUX 5134e74e91
UX: also plays notification sounds in group channels (#27176)
Prior to this fix we were limiting this to 1:1 channels.
2024-05-24 17:48:07 +02:00
Mark VanLandingham 971b66e440
DEV: Move webhook event header modifier for redelivery-recalucation (#27177) 2024-05-24 10:37:10 -05:00
Ted Johansson 69205cb1e5
DEV: Catch missing translations during test runs (#26258)
This configuration makes it so that a missing translation will raise an error during test execution. Better discover there than after deploy.
2024-05-24 22:15:53 +08:00
Arpit Jalan 9db83c37e4
FIX: When creating new message via URL do not redirect (#27153)
* FIX: When creating new message via URL do not redirect

If a user clicks on `/new-message` route from inside the instance we're
redirecting the user to `/latest` page which is only intended if the
user is coming from an external site. This commit checks for this
condition and only redirects when user is coming from external source.

This also makes the behavior consistent with `new-topic` route.

Internal topic reference: `/t/-/129523/`
2024-05-24 17:25:37 +05:30
Selase Krakani 949c70372c
DEV: Add support for various fields in generic bulk importer (#27114)
* user_profiles - `location`
* users - `date_of_birth`
* topics - `pinned_at`, `pinned_until`, `pinned_globally`

This also include changes to correctly import PMs. Currently PM topics
are skipped because of a check in `import_users` step which requires `category_id`
to be present.
2024-05-24 13:46:06 +02:00
Joffrey JAFFEUX d5066336ec
UX: reduces idle time to 0 on chat (#27158)
We consider that you should always receive a notification sound when someone speaks directly with you in chat.

This commit also refactors the way we play audio in chat to make it simpler and throttle it to 3 seconds.

We also added a safeguard to ensure we won't play sounds for old messages, this case can happen when message bus is catching up the backlog (eg: in an inactive tab for example).
2024-05-24 11:18:11 +02:00
David Battersby c39a4de139
FIX: load existing chat dm channel via url (#26998)
When users click a link that points to an existing group chat, we should reopen that chat instead of creating a new group chat so users can more easily continue ongoing conversations.
2024-05-24 12:12:49 +04:00
Krzysztof Kotlarek 89401d5fc1
FIX: flaky user_merger_spec.rb (#27169)
Flag guardian spec needs to clean state after evaluation. Each created flag is adding PostActionType.
2024-05-24 15:23:59 +10:00
Krzysztof Kotlarek 99e27c4fd5
FIX: change around to after in flag spec (#27168) 2024-05-24 12:55:21 +10:00
Alan Guo Xiang Tan df16ab0758
FIX: `S3Inventory` to ignore files older than last backup restore date (#27166)
This commit updates `S3Inventory#files` to ignore S3 inventory files
which have a `last_modified` timestamp which are not at least 2 days
older than `BackupMetadata.last_restore_date` timestamp.

This check was previously only in `Jobs::EnsureS3UploadsExistence` but
`S3Inventory` can also be used via Rake tasks so this protection needs
to be in `S3Inventory` and not in the scheduled job.
2024-05-24 10:54:06 +08:00
Krzysztof Kotlarek a4c5f85b10
FIX: flaky post action counts specs (#27165)
After flags were moved to the database, with each save they are changing available PostActionTypes. Therefore, flag specs should clear the state before and after each example not just before.

In addition, we need to clear `nil` counts for dynamically created flags from serializer.
2024-05-24 11:55:32 +10:00
Jeff Wong 3a3ee5e04a
DEV: replace .each with .find_each for paginated queries (#27159)
Large batches of reviewables may require paginated queries.
2024-05-23 15:42:21 -07:00
Penar Musaraj f9192835a7
FIX: Do not reset sidebar defaults in wizard (#27156)
We removed the option to enable/disable the sidebar in the wizard in
https://github.com/discourse/discourse/pull/26926, but these lines of
code were resetting it quietly to `header_dropdown`.
2024-05-23 16:45:47 -04:00
Jeff Wong 755f8de6d4
FEATURE: add agree and edit (#27088)
* FEATURE: add agree and edit

adds agree and edit - an alias for agree and keep -- but with a client action to
edit the post in the composer before the flag is agreed with

---------

Co-authored-by: Juan David Martinez <juan@discourse.org>
2024-05-23 11:21:42 -07:00
David Battersby 3f099ad268
UX: add space to following list (#27154)
Adds vertical spacing between follower/following list.
2024-05-23 17:26:15 +04:00
Jan Cernik 1ed1a1f96a
FIX: Add onebox support for x.com (#27140) 2024-05-23 10:25:42 -03:00
Jan Cernik ebc3af90eb
DEV: More system specs for signup/login (#27150) 2024-05-23 10:01:05 -03:00
Ted Johansson 7b437c9401
FEATURE: Implement new required options in admin user fields UI (#27079)
We're planning to implement a feature that allows adding required fields for existing users. This PR does some preparatory refactoring to make that possible. There should be no changes to existing behaviour. Just a small update to the admin UI.
2024-05-23 19:18:25 +08:00
Joffrey JAFFEUX f5e41f0627
FIX: correctly generate pm path on user (#27152)
Before this fix when generating a pm path leading to a group messages inbox we would blindly take the first group of the pm, however, it's possible our current user doesn't have access to this group.

This commit will now try to find the first group the user has access to, and generate a path to this group’s inbox.
2024-05-23 11:17:43 +02:00
Joffrey JAFFEUX b3802e12f0
FIX: correct in_thread? message logic (#27151)
A message is in a thread if:
- it has a thread_id
- it is in threading_enabled channel OR the associated thread is marked as `force`
2024-05-23 11:08:55 +02:00
Alan Guo Xiang Tan f84eda7c8d
FIX: `Post#each_upload_url` yielding external URLs (#27149)
This commit updates `Post#each_upload_url` to reject URLs that do not
have a host which matches `Discourse.current_hostname` but follows the
`/uploads/short-url` uploads URL format. This situation most commonly
happen when users copy upload URL link between different Discourse
sites.
2024-05-23 15:15:16 +10:00
Krzysztof Kotlarek 13848594d2
FIX: don't load database flag when database is disabled (#27148)
When the database is disabled, flags cannot be loaded. In that case, we should fallback to static FlagSetting.
2024-05-23 13:24:13 +10:00
chapoi 3655b41ee4
UX: add ellipsis to usernames in topic post map (PMs) (#27137) 2024-05-23 12:40:52 +10:00
Krzysztof Kotlarek cfbbfd177c
DEV: move post flags into database (#27125)
This is preparation for a feature that will allow admins to define their custom flags. Current behaviour should stay untouched.
2024-05-23 12:19:07 +10:00
Martin Brennan 312a930ac8
UX: Disable plugin list settings button for some plugins (#27124)
For plugins with only an "enabled" site setting, it doesn't
make sense to take them to the site settings page, since the
toggle switch in the list can be used to change enabled/disabled.

This will not be the case for plugins that have their own custom
config page (like Automation), but we will deal with this when
we actually overhaul this plugin to use the new show page.

Also adds another rspec fixture of a test plugin.
2024-05-23 12:04:26 +10:00
Ted Johansson 3137e60653
DEV: Database backed admin notices (#26192)
This PR introduces a basic AdminNotice model to store these notices. Admin notices are categorized by their source/type (currently only notices from problem check.) They also have a priority.
2024-05-23 09:29:08 +08:00
dependabot[bot] 7e8e803785
Build(deps): Bump sass-embedded from 1.77.1 to 1.77.2 (#27144)
Bumps [sass-embedded](https://github.com/sass-contrib/sass-embedded-host-ruby) from 1.77.1 to 1.77.2.
- [Commits](https://github.com/sass-contrib/sass-embedded-host-ruby/compare/v1.77.1...v1.77.2)

---
updated-dependencies:
- dependency-name: sass-embedded
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 01:14:52 +02:00
dependabot[bot] 82fef25f19
Build(deps): Bump simpleidn from 0.2.2 to 0.2.3 (#27145)
Bumps [simpleidn](https://github.com/mmriis/simpleidn) from 0.2.2 to 0.2.3.
- [Commits](https://github.com/mmriis/simpleidn/commits)

---
updated-dependencies:
- dependency-name: simpleidn
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 00:59:30 +02:00
dependabot[bot] 184aba998a
Build(deps-dev): Bump selenium-webdriver from 4.20.1 to 4.21.1 (#27146)
Bumps [selenium-webdriver](https://github.com/SeleniumHQ/selenium) from 4.20.1 to 4.21.1.
- [Release notes](https://github.com/SeleniumHQ/selenium/releases)
- [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES)
- [Commits](https://github.com/SeleniumHQ/selenium/commits)

---
updated-dependencies:
- dependency-name: selenium-webdriver
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 00:58:43 +02:00
dependabot[bot] b62f0ae918
Build(deps): Bump minitest from 5.23.0 to 5.23.1 (#27143)
Bumps [minitest](https://github.com/minitest/minitest) from 5.23.0 to 5.23.1.
- [Changelog](https://github.com/minitest/minitest/blob/master/History.rdoc)
- [Commits](https://github.com/minitest/minitest/compare/v5.23.0...v5.23.1)

---
updated-dependencies:
- dependency-name: minitest
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 00:57:37 +02:00
dependabot[bot] aa60dd8e29
Build(deps): Bump @embroider/addon-shim in the embroider group (#27142)
Bumps the embroider group with 1 update: [@embroider/addon-shim](https://github.com/embroider-build/embroider/tree/HEAD/packages/addon-shim).


Updates `@embroider/addon-shim` from 1.8.8 to 1.8.9
- [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/addon-shim)

---
updated-dependencies:
- dependency-name: "@embroider/addon-shim"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: embroider
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 00:32:09 +02:00
Joffrey JAFFEUX 22237e4407
FIX: set active thread on correct channel (#27141)
activeChannel is something we should use less and less as it could not exist, in this case we have the channel right here in the function so there's no reason to reach for `this.chat.activeChannel`.
2024-05-22 23:38:12 +02:00
Joffrey JAFFEUX 4553bb1717
UX: reset idle on tab focus (#27139)
When users come back to a tab we should consider they are not idle anymore.
2024-05-22 22:13:08 +02:00
marstall d75339af76
DEV: let reply_by_email, visit_link_to_respond email strings be modified by plugins (#27133)
* DEV: allow reply_by_email, visit_link_to_respond strings to be modified by plugins

* DEV: separate visit_link_to_respond and reply_by_email modifiers out
2024-05-22 15:33:06 -04:00
Joffrey JAFFEUX 485427b578
FIX: correctly handles near-message-with-thread route in drawer (#27115)
Prior to this fix we wouldn't intercept it, and we also wouldn't handle it, which in result would cause us to handle as a full page interaction and open the full page chat even if you were in drawer mode.
2024-05-22 21:03:40 +02:00
Keegan George 0d49571279
DEV: Make uppy markdown resolvers async/await (#27117) 2024-05-22 11:13:25 -07:00
Penar Musaraj 9d7f374c0f
DEV: Fix a flakey test, skip another one (#27132) 2024-05-22 11:59:47 -04:00