Commit Graph

37515 Commits

Author SHA1 Message Date
05beaa7f45 DEV: Remove override of flushdb in DiscourseRedis. 2020-05-19 10:26:23 +08:00
96c02caba7 DEV: Change use of Redis flushall to flushdb.
FLUSHALL removes all keys from all databases. Instead we only want to
remove keys from the current Redis database.
2020-05-19 10:20:00 +08:00
f99f6ca111 FIX: randomize file name when created from fixtures (#9731)
* FIX: randomize file name when created from fixtures

When a temporary file is created from fixtures it should have a unique name.
It is to prevent a collision in parallel specs evaluation

* FIX: use /tmp/pid folder to keep fixture files
2020-05-19 09:09:36 +10:00
16f6240782 FIX: Bump rack version from 2.0.8 to 2.2.2 (#9811)
Version 2.1.1 was not working with our Sidekiq but version 2.2.2 is fine
2020-05-19 08:43:45 +10:00
6d5e9db883 FIX: Restoring backup didn't clear cached translation overrides 2020-05-18 18:51:51 +02:00
27c611b1d1 FIX: Reverting multiple translation overrides didn't clear cache 2020-05-18 18:51:29 +02:00
cfad38184d FIX: improves and fixes a regression with category-selector (#9821) 2020-05-18 17:44:47 +02:00
96848b7649 UX: Allow secure media URLs to be cached for a short period of time
Signed S3 URLs are valid for 15 seconds, so we can safely allow the browser to cache them for 10 seconds. This should help with large numbers of requests when composing a post with many images.
2020-05-18 15:00:41 +01:00
303dece5ee DEV: skip this test for now (#9818)
It seems to be involved in various random failures
2020-05-18 15:37:58 +02:00
1876b3cc4c FIX: more resilient/consistent date-picker loading (#9817) 2020-05-18 15:29:24 +02:00
48ed1b40cf REFACTOR: ensures later is correctly canceled (#9796) 2020-05-18 14:20:23 +02:00
9482ddff73 UX: show caret only in topic footer buttons dropdown select boxes (#9816) 2020-05-18 14:07:40 +02:00
f968155288 FIX: Ensure no image downloads during topic thumbnail serialization
If image uploads are missing a width/height, we re-download them to update the width/height in the database. However, this takes significant resources so we don't want to run this logic during topic serialization.
2020-05-18 12:04:29 +01:00
918bd75909 FIX: allows to remove a topic timer with delete_replies as type (#9800) 2020-05-18 11:47:08 +02:00
d01c336899 DEV: Clean up some Redis leaks in test env. 2020-05-18 17:27:37 +08:00
320b21ab5b UX: allows dropdown-select-box to display a caret (#9803)
```
selectKitOptions: {
  showCaret: true // default false
}
```
2020-05-18 10:50:33 +02:00
e5dc843185 FIX: ensures hide is called when card is destroyed (#9814) 2020-05-18 10:10:40 +02:00
862773ec83 FIX: do not remove stop words when using English locale
PG already handles English stop words, the list in cppjieba is
bigger than the list PG uses, which in turn causes confusion cause
words such as "volume" are stripped using cppijieba stop word list

We will follow up with another commit here to apply the Chinese
word stopwords, but for now to eliminate the confusion we are
skipping applying the stopword list when the dictionary in PG is
in English.
2020-05-18 10:54:56 +10:00
ea63fa7de7 FIX: extract reset_last_seen_cache! in user_spec (#9808)
Helper method to avoid code duplication
2020-05-18 09:13:37 +10:00
e81a4048e3 REFACTOR: s/focusAfterOnchange/focusAfterOnChange (#9801) 2020-05-16 11:20:37 +02:00
db8e872bda DEV: Move select kit to an addon (#9797) 2020-05-15 16:07:35 -04:00
7f07c513a7 FIX: Switching composer action does not refresh composer actions content (#9791) 2020-05-15 13:54:44 -04:00
6b04760572 FIX: Component was still used by data explorer 2020-05-15 13:52:03 -04:00
eee20a9814 FIX: Include plugin CSS assets when previewing themes 2020-05-15 18:12:53 +01:00
f86b123cfc DEV: Remove use of const in untranspiled js 2020-05-15 17:55:34 +01:00
ac042c2bbe UX: Fetch higher-resolution youtube thumbnails where available
We have been using YouTube's 'hqdefault.jpg' image which works consistently to provide a 480x360 thumbnail. YouTube does provide larger thumbnails, but not consistently for every video. By using og:image, we will fetch the best resolution YouTube can provide for each video.

This commit also refactors lazy-yt to re-use the thumbnail already existing in the cooked content. This means we get lazy-loading for free, and avoid hotlinking images to YouTube (when download remote images is enabled on the site).
2020-05-15 17:49:27 +01:00
7edd312f85 UX: focus category name when editing category (#9795) 2020-05-15 18:27:06 +02:00
b07f1bfd93 FIX: displays a title on sk header if no selected name (#9794)
none has to be defined.
2020-05-15 17:36:00 +02:00
9810ca1dbd UX: Add copied text upon copy button click (#9793) 2020-05-15 17:08:46 +02:00
3a615a8bdd Update description of level 0 user limitations
With the default configuration new users can post 1 image.
2020-05-15 22:48:17 +08:00
769611f2d9 Build(deps-dev): Bump ruby-prof from 1.4.0 to 1.4.1 (#9790)
Bumps [ruby-prof](https://github.com/ruby-prof/ruby-prof) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/ruby-prof/ruby-prof/releases)
- [Changelog](https://github.com/ruby-prof/ruby-prof/blob/master/CHANGES)
- [Commits](https://github.com/ruby-prof/ruby-prof/compare/1.4.0...1.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-05-15 10:13:49 -04:00
26c2fb4354 DEV: skip click track test (#9792)
This test might be responsible of random test failures, skip this for now to check if the random failure sill happens after dozens of tests.
2020-05-15 16:12:22 +02:00
d1146ccb7b Revert "FIX: Correct plugin api version bump."
This reverts commit 6a96c424b758b32ff63f78a74ada50090e7334ed.

False alarm. I was deploying on a docker image which was still on 0.9.0.
2020-05-15 21:22:44 +08:00
6a96c424b7 FIX: Correct plugin api version bump.
It doesn't seem to be following semver.
2020-05-15 21:17:50 +08:00
461b4e5cc6 DEV: Add framework for filtered plugin registers (#9763)
* DEV: Add framework for filtered plugin registers

Plugins often need to add values to a list, and we need to filter those lists at runtime to ignore values from disabled plugins. This commit provides a re-usable way to do that, which should make it easier to add new registers in future, and also reduce repeated code.

Follow-up commits will migrate existing registers to use this new system

* DEV: Migrate user and group custom field APIs to plugin registry

This gives us a consistent system for checking plugin enabled state, so we are repeating less logic. API changes are backwards compatible
2020-05-15 14:04:38 +01:00
0495a748d0 FIX: Use CDN URLs for topic thumbnails 2020-05-15 13:35:20 +01:00
162d125b83 Fix lint. 2020-05-15 20:23:17 +08:00
dada1fc417 UX: Better composer-action icon when creating new topic. 2020-05-15 16:40:49 +08:00
f9a9bd136b FEATURE: Expose Composer.serializeToTopic in client side plugin api. 2020-05-15 16:16:58 +08:00
858735b5da DEV: Fix broken test due to 9ab5801a1bc5bfc505673d0c74f1a3c1e6c28461. 2020-05-15 15:00:04 +08:00
9ab5801a1b FIX: Allow post migrations using #change to carry out unsafe migration 2020-05-15 14:23:27 +08:00
4601833e4e PERF: ensure we run full GC on contexts
Prior to this change we would never clear memory from contexts and
rely on V8 reacting to pressure

This could lead to bloating of PrettyText and Transpiler contexts

This optimisations ensures that we will clear memory 2 seconds after
the last eval on the context
2020-05-15 14:01:54 +10:00
0cbaa8d813 FEATURE: extend duration allowed for download
Previously we would raise a warning in the logs if downloading
a file (from s3) takes longer than 60 seconds.

At scale this happens reasonably frequently.

1. Raised the duration to 3 minutes

2. Pulled the resizing mutex out of the downloading mutex
so we have less and clearer error logs
2020-05-15 12:45:47 +10:00
165fa13c9d FIX: Always return 0 for non-human user current DraftSequence. 2020-05-15 10:40:36 +08:00
245e8212ca Revert "FIX: don't compute draft for (ro)bots 🤖 in topics list"
This reverts commit ec8f08d0da1b32213f3674d8e6dd8ff98e84d39d.
2020-05-15 10:40:35 +08:00
e37ea4a4a1 Revert "FIX: don't compute draft for bots on categories index route"
This reverts commit 1b7f23a1bc79e323a93cdcc06bbdc499a128a72b.
2020-05-15 10:40:35 +08:00
1a2b9435b0 DEV: Standardize table sorting verbiage (#9757)
* DEV: Standardize table sorting verbiage

This commit creates a common component that tables can use to make their
headers sortable. This commit also standardizes on using `desc` as the
default and passing in the `asc=true` flag to adjust the sorting
direction.

* Add deprecation warnings

Adds deprecation warnings if using previous params and maintains
backwards compatibility. Set the default sort value for group members to
be asc.

* switch group requests to use common table-header-toggle

* update fixture
2020-05-14 20:10:59 -06:00
11cd149122 FIX: WebAPK minting was broken due to shortcut icons
SVG support is very flaky, but this way at least minting works again
2020-05-14 21:56:35 -03:00
65a3fdbc57 FIX: randomly failing user_spec (#9754)
* FIX: randomly falling user_spec

When we evaluate `update_last_seen!` we relay on Redis to not run that code too often

https://github.com/discourse/discourse/blob/master/app/models/user.rb#L753

The problem is that not all specs which are running `update_last_seen!` are not cleaning after themselves

For examples specs in that block https://github.com/discourse/discourse/blob/master/spec/models/user_spec.rb#L901

So it can be replicated when you run a few times
`bundle exec rspec  ./spec/models/user_spec.rb -e "should not update the first seen value if it doesn't exist" -e "should have 0 for days_visited"`

We should delete Redis key after each spec which is evaluating `update_last_seen!`
2020-05-15 09:24:07 +10:00
869f9b20a2 PERF: Dematerialize topic_reply_count (#9769)
* PERF: Dematerialize topic_reply_count

It's only ever used for trust level promotions that run daily, or compared to 0. We don't need to track it on every post creation.

* UX: Add symbol in TL3 report if topic reply count is capped

* DEV: Drop user_stats.topic_reply_count column
2020-05-14 15:42:00 -07:00