Commit Graph

43053 Commits

Author SHA1 Message Date
f3df5834b6 FEATURE: Add game consoles to unsupported browsers (#14294)
The server will automatically serve the crawler view to game console
browsers. Neither PlayStation or Xbox can render Discourse because not
all required browser APIs are present.
2021-09-10 10:35:01 +08:00
bc23dcd30b FIX: Don't publish PM archive events to acting user. (#14291)
When a user archives a personal message, they are redirected back to the
inbox and will refresh the list of the topics for the given filter.
Publishing an event to the user results in an incorrect incoming message
because the list of topics has already been refreshed.

This does mean that if a user has two tabs opened, the non-active tab
will not receive the incoming message but at this point we do not think
the technical trade-offs are worth it to support this feature. We
basically have to somehow exclude a client from an incoming message
which is not easy to do.

Follow-up to fc1fd1b41689694b3916dc4e10605eb9b8bb89b7
2021-09-10 09:20:50 +08:00
2215cc2547 DEV: Refactor uppy plugin interfaces (#14275)
This abstracts interaction with uppy for uppy plugin classes
into base classes for Preprocessor  plugins, so anyone
making these uppy plugins doesn't have to think as much about uppy
underneath the hood. This also makes the logging and validation
nicer, and provides a more consistent way to emit progress and
completion events.

In a future commit, we will introduce another base class for
`UploadUploaderPlugin` which will be used to be able to hijack
the upload process to go to a different provider (e.g. for discourse-video)
2021-09-10 09:09:47 +10:00
05c356f7c6 DEV: Add rake task to check that the DB can be accessed (#14300) 2021-09-09 14:42:10 -05:00
789613fe51 DEV: Run Ember CLI tests in Firefox evergreen too (#14283)
Increases timeout and removes parallelism to make it stable.
2021-09-09 16:32:56 -03:00
6262396d8a FIX: Don't attempt to migrate multisite test db while holding the mutex (#14298)
Since you'll have to wait for the mutex to timeout before it can
continue.
2021-09-09 13:31:52 -05:00
3469f7b74f DEV: Work around HTMLElement.innerText differences between browsers (#14297) 2021-09-09 14:01:22 -03:00
009d18e497 markdown_linkify_tlds: Added onion in default 2021-09-09 11:38:50 -04:00
24e71acf3f UX: Normalize sizing for inputs, buttons, dropdowns (#14226)
See PR for details
2021-09-09 11:01:56 -04:00
76f0cf10e6 FIX: Resolve short URLs after diffHTML was loaded (#14296)
Short URLs were resolved before diffHTML was loaded and content was
swapped by it, which meant that no URLs were found and the URLs remained
unsolved. This caused image elements to be blank.

* DEV: Updated diffHTML to 1.0.0-beta.20
2021-09-09 16:25:58 +03:00
02a6b991fe FIX: Correct the play icon position (#14295) 2021-09-09 15:10:32 +02:00
1205db8f84 DEV: Don't check the defaultState every time a widget is rendered
This only happens in development mode but still ends up calling the
method unnecessarily.
2021-09-09 08:42:03 -04:00
0532a5a43e FIX: Do not replace in mentions and hashtags (#14260)
Watched words of type 'replace' or 'link' replaced the text inside
mentions or hashtags too, which broke these. These types of watched
words must skip any match that has an @ or # before it.
2021-09-09 12:03:59 +03:00
7b77dd5c05 FIX: Display unread/new PM links only when viewing own user. (#14290)
At this point in time, we do not think supporting unread and new when an
admin is looking at another user's messages is worth supporting.

Follow-up to fc1fd1b41689694b3916dc4e10605eb9b8bb89b7
2021-09-09 14:02:17 +08:00
ee8c943326 FIX: Remove dismissed new topics from PM topic tracking state. (#14288)
Follow-up to fc1fd1b41689694b3916dc4e10605eb9b8bb89b7
2021-09-09 12:39:27 +08:00
c92818ae5f FIX: Remove dismiss read topics from PM topic tracking state. (#14287)
Follow-up to fc1fd1b41689694b3916dc4e10605eb9b8bb89b7
2021-09-09 10:59:39 +08:00
85e95c9ec5 FIX: Better positioning for "Skip to main content" button (#14286) 2021-09-08 21:28:55 -04:00
412587f70a FEATURE: Publish read topic tracking events for private messages. (#14274)
Follow-up to fc1fd1b41689694b3916dc4e10605eb9b8bb89b7
2021-09-09 09:16:53 +08:00
1e05175364 PERF: Avoid running query unnecessarily when updating bookmark. (#14276)
* Avoid loading an entire ActiveRecord object when saving and updating.
* Avoid running a DB query when `post_id` or `user_id` is not changed.
2021-09-09 10:50:26 +10:00
13b31def80 FIX: Ember CLI was being hijacked before potential errors
This was problematic if something like SCSS file throws an error as the
app would tell Ember CLI to bootstrap as if everything is fine and not
display the error.

The fix is to only hijack the rendering at the end of the template
instead of the beginning.
2021-09-08 16:07:54 -04:00
0dab1634b0 FIX: Composer height issue in Safari on iOS 15 (#14282) 2021-09-08 13:35:09 -04:00
11a07b37e1 FIX: ignore canonical link for medium.com oneboxes (#14278)
https://meta.discourse.org/t/bug-in-onebox-link-being-rendered-as-a-gist-when-it-isnt/202463
2021-09-08 20:19:57 +05:30
01341f33e3 FIX: do not show spoiler content in RSS (#14277)
This commit updates the RSS post content to use email formatting. Many
plugins are using the `reduce_cooked` method to format content that is
not displayed outside of Discourse application. Using email formatting
also strips the secure media and various other things that is only meant
for Discourse client side application.
2021-09-08 20:19:43 +05:30
95b15acb1e DEV: uses forked Mousetrap to avoid leaking listeners (#14198) 2021-09-08 14:48:13 +02:00
e1581f6dfd DEV: Use discourse image redis in CI (#14280) 2021-09-08 14:01:37 +02:00
943f0dcfa0 DEV: Add support to Ember CLI for running message format in tests (#14271) 2021-09-08 14:00:29 +02:00
8e60bce903 FIX: Always show the creation date of posts in crawler view (#14269)
The modification date should always be a meta tag to make this less confusing. Especially for imported posts.
That's more in line with how the rest of Discourse presents post dates.
2021-09-08 11:03:55 +02:00
5de64b3630 FIX: Correct highest post number for read topic tracking state. (#14273) 2021-09-08 11:55:12 +08:00
e3793e6d7c FIX: better filter for groups search (#14262)
Follow up of https://github.com/discourse/discourse/pull/14216

Allow plugins to register custom filter with block
2021-09-08 09:38:45 +10:00
cddba50570 FIX: Error in Ember CLI environment
There are a few fixes at play here:

1) We were still not initializing objects to the correct types.

2) If a debounce timed out, it was returning a string instead of an
array which was not appropriately handled.

3) In testing mode we never cancel the search promise for stability.
2021-09-07 15:26:34 -04:00
f4cca4af75 DEV: Do not clean up chat message uploads (#14267) 2021-09-07 13:33:48 -05:00
5c0ad215af UX: adjust button spacing (#14230) 2021-09-07 13:19:03 -04:00
a71b7df0a0 DEV: Run Ember tests daily with plugins (#14261) 2021-09-07 14:17:04 -03:00
c6bcf1f06c DEV: Add site.json to api docs (#14249)
Documenting the site.json api endpoint. This endpoint is often used as a
way to get all of the categories and subcategories in a single api call.
2021-09-07 10:36:05 -06:00
d500c436c6 DEV: Add license field to api docs info section (#14248)
One of the fields that should be present for openapi docs is the "license"
field.

https://spec.openapis.org/oas/latest.html#infoObject

Our API docs already had a license, so this commit just specifies that
and provides a link to it.
2021-09-07 10:35:56 -06:00
d51d94f771 A11Y: do not default to label for aria-label (#14258) 2021-09-07 18:24:39 +02:00
f513266bcb Update translations (#14266) 2021-09-07 15:43:26 +02:00
aaa8a379b9 DEV: Don't transition miniprofiler on first page load. (#14265)
See https://meta.discourse.org/t/-/202482/5
2021-09-07 13:44:49 +08:00
fc1fd1b416 FEATURE: Display new/unread count in browse more messages for PMs. (#14188)
In order to include the new/unread count in the browse more message
under suggested topics, a couple of technical changes have to be made.

1. `PrivateMessageTopicTrackingState` is now auto-injected which is
   similar to how it is done for `TopicTrackingState`. This is done so
we don't have to attempt to pass the `PrivateMessageTopicTrackingState`
object multiple levels down into the suggested-topics component. While
the object is auto-injected, we only fetch the initial state and start
tracking when the relevant private messages routes has been hit and only
when a private message's suggested topics is loaded. This is
done as we do not want to add the extra overhead of fetching the inital
state to all page loads but instead wait till the private messages
routes are hit.

2. Previously, we would stop tracking once the `user-private-messages`
   route has been deactivated. However, that is not ideal since
navigating out of the route and back means we send an API call to the
server each time. Since `PrivateMessageTopicTrackingState` is kept in
sync cheaply via messageBus, we can just continue to track the state
even if the user has navigated away from the relevant stages.
2021-09-07 12:30:40 +08:00
cb63c297b3 DEV: Warm ActiveRecord cache for Sidekiq after Rails initializes. (#14253)
Sidekiq was failing to boot in dev due to the following error. It seems
like constantizing stuff before the autoloader has kicked in caused
stuff to go weird. Root cause has not been identified but there is no
reason for us to have to warm up the cache during the initialization of
Rails.

```
2021-09-06T04:28:43.338Z pid=112028 tid=26vc WARN: NameError: uninitialized constant #<Class:0x0000564b365040d8>::RateLimiter
2021-09-06T04:28:43.338Z pid=112028 tid=26vc WARN: /discourse/app/models/post.rb:9:in `<class:Post>'
/discourse/app/models/post.rb:6:in `<top (required)>'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:26:in `require'
```
2021-09-07 11:08:32 +08:00
d429dcfaca DEV: Stop ignoring bookmarks.delete_when_reminder_sent (#14264)
This was ignored a long time ago in
8dc3543134170e73d3bd504a5a3923e869b03691
2021-09-07 12:38:18 +10:00
9f36d8ad43 FIX: Capture CC addresses for forwarded emails (#14254)
When forwarding emails into the group inbox, we now use the
original sender email as the from_address since
2ac9fd9dff5a2a9210e2b1b765e1a324bbb4f421. However, we have not
been saving the original CC addresses of the forwarded email,
which are needed to include those recipients in on the conversation
when replying via the group inbox.

This commit captures the CC addresses on the incoming email, and
makes sure the emails are created as staged users and added to the
list of topic allowed users so they are included on CC's sent by
the GroupSmtpEmail and other jobs.
2021-09-07 08:46:28 +10:00
193da4c3b4 REFACTOR: Remove unneeded mobile hbs file (#14259) 2021-09-06 13:01:44 -05:00
8f9e692e41 FEATURE: enable users to choose unseen as a default view (#14242) 2021-09-06 21:51:52 +04:00
34ff7bfeeb FEATURE: Hide suspended users from site-wide search to regular users (#14245) 2021-09-06 09:59:35 -04:00
0c777825b3 FIX: perform agree_and_keep action only if possible. (#13967)
While deleting spammers from flag modal it's trying to perform `agree_and_keep` action where it's not possible (or already performed).
2021-09-06 11:41:44 +05:30
7b392cee50 FIX: Correct the forwarded by user small post for group inbox (#14252)
When 2ac9fd9dff5a2a9210e2b1b765e1a324bbb4f421 was done, this
affected the small post that is created when forwarding an email
into the group inbox. Instead of using the name and the email of
the user who forwarded the email, it used the original from email
and name to create the small post. So instead of something like
"Discourse Team forwarded the above email" we ended up with
"John Smith forwarded the above email" which is incorrect.

This fixes the issue by creating a staged user for the forwarding
email address (if such a user does not yet exist) and uses that
for the "forwarded" small post instead.
2021-09-06 15:02:13 +10:00
1937474e84 PERF: Avoid additional database query when viewing own user. (#14239) 2021-09-06 10:38:07 +08:00
b09688a153 DEV: Require uppy.js in theme_qunit_vendor.js (#14251)
The smoke test has been failing with the error:

```
TypeError: Cannot read properties of undefined (reading 'Core')
```

Since de20c46077
 and 9873a942e3d2df367717f119c591492c690d291d this error has been occurring,
possibly now because Uppy is required by a plugin. Adding uppy.js into
the require list for theme_qunit_vendor.js fixes the issue.
2021-09-06 10:49:44 +10:00
dd4b8c2afa FIX: Use random file name for temporary uploads (#14250)
Other locale characters in file names (e.g. é, ä) as well
as special characters can cause issues on S3, notably the S3
copy object operation does not support these special characters.
Instead of storing the original file name in the key, which is
unnecessary, we now generate a random file name with the original
extension for the temporary file and use that for all external
upload stub operations.
2021-09-06 10:21:20 +10:00