Commit Graph

5134 Commits

Author SHA1 Message Date
Guo Xiang Tan cfa7898c2d Rename `TopicView#last_read_post_id` to `TopicView#filtered_post_id`. 2018-06-27 12:33:57 +08:00
Guo Xiang Tan cb69888758 PERF: Don't pluck all the columns just to retrieve a single value. 2018-06-27 11:41:35 +08:00
misaka4e21 47cb46671a FEATURE: Support disabling tag creation for non-staff users. 2018-06-27 07:15:02 +08:00
Arpit Jalan 6bcdc3ba4b FEATURE: allow author to delete posts irrespective of post_edit_time_limit 2018-06-26 21:43:06 +05:30
Guo Xiang Tan 49ffc1eb61 Revert "PERF: Send down gaps as the relevant posts load instead of front loading."
This reverts commit 4c3352528e.
2018-06-26 12:54:14 +08:00
Guo Xiang Tan 4c3352528e PERF: Send down gaps as the relevant posts load instead of front loading. 2018-06-26 12:49:06 +08:00
Guo Xiang Tan 0b6a2e9d1f Remove force summary mode for megatopics for now.
The logic is too hairy and we can't reliably determine
when to force summary mode. Work is underway to improve
perf for megatopics so this will not be required
eventually.
2018-06-26 12:49:06 +08:00
Guo Xiang Tan 5100a62fc0 FIX: Megatopics forced into summary mode when loading posts. 2018-06-25 22:11:56 +08:00
David Lee 4644d777bd FEATURE: add website field to SSO 2018-06-25 16:09:39 +10:00
Jeff Wong 41f76a74f8 FEATURE: send message when a user reaches tl1 2018-06-22 13:20:00 -07:00
Robin Ward 6901e0e043 FIX: Rails.logger isn't always available when loading plugin locales 2018-06-22 10:20:20 -04:00
Guo Xiang Tan 50f14c6e61 Prefer `update!` -> `update!`. 2018-06-22 15:13:04 +08:00
Guo Xiang Tan f69356e628 FIX: Users can't "show all posts" in forced summary topics. 2018-06-22 11:32:45 +08:00
Neil Lalonde 544254f7a8 Version bump to v2.1.0.beta2 2018-06-21 10:41:52 -04:00
Guo Xiang Tan 97d8cd820e No need to expire readonly mode key immediately. 2018-06-21 17:52:42 +08:00
Guo Xiang Tan 9a7a079f4d Force summary mode when user enters at the top of megalodoon topics. 2018-06-21 15:18:52 +08:00
Guo Xiang Tan f7d22bad90 FEATURE: Forced summary mode for megalodon topics.
This is mainly done for performance reasons and megalodon
topics are usually a byproduct of imports where site setting
limits are not respected.
2018-06-21 14:00:20 +08:00
Guo Xiang Tan 5cef4e281b PERF: Memoize `TopicView#gaps` results. 2018-06-21 12:37:24 +08:00
Sam 2d59d06916 PERF: mega_topics get no post counts per user 2018-06-21 11:09:45 +10:00
Sam f66efc601d FIX: cubot android devices were detected as crawlers 2018-06-21 10:56:46 +10:00
Joffrey JAFFEUX 2f7960bd2a
DEV: updates prettier and displays linters/prettifiers version in CI 2018-06-20 18:34:49 +02:00
Joffrey JAFFEUX 8126b603e4
fix prettier 2018-06-20 18:26:43 +02:00
Joffrey JAFFEUX c5c1b45d19
higher loglevel for prettier 2018-06-20 16:51:48 +02:00
Guo Xiang Tan 0365806b93 FIX: Properly display error when post action fails to create. 2018-06-20 21:20:23 +08:00
Guo Xiang Tan ff5fc3cb08 Use a fixed limit for mega topic posts count. 2018-06-20 16:58:52 +08:00
Guo Xiang Tan 9c925a66ff PERF: Don't display days ago on timeline for megatopics.
Analysis using `pg_stat_statements` showed this query
to be eating up a significant portion of CPU.
2018-06-20 16:25:54 +08:00
Sam cbdab71179 PERF: stop counting participants on very large topics
This query gets very expensive and can be bypassed on large topics
2018-06-20 18:11:39 +10:00
Sam 2f0e73f2d6 DEV: fast pluck to use type_map in mini_sql 2018-06-20 17:53:49 +10:00
Sam 44091f20c6 DEV: allow for method deprecation using Discourse.deprecate
New method deprecator will ensure one log message an hour happens
for all deprecated method calls per call site

Also removes unused monkey patches to ActiveRecord::Base
2018-06-20 17:53:49 +10:00
Sam cb824a6b33 DEV: remove all calls to SqlBuilder use DB.build instead
This is part of the migration to mini_sql, SqlBuilder.new is being
deprecated and replaced with DB.build
2018-06-20 17:53:49 +10:00
Guo Xiang Tan 806f0ca19d FIX: URL with params for svg images should not be light boxed. 2018-06-20 10:47:14 +08:00
Arpit Jalan aedc61a3b4 FEATURE: allow large icon to be uploaded in wizard 2018-06-19 21:08:02 +05:30
Joffrey JAFFEUX 24c27b5321
FEATURE: adds a add_report method accessible in plugin.rb 2018-06-19 15:00:11 +02:00
Guo Xiang Tan 7eff64773c Revert "FIX: Don't clear active connections in defer queue."
This reverts commit c9feadf9ec.
2018-06-19 17:58:21 +08:00
Guo Xiang Tan df24c51c6f Revert "FIX: Don't try to dequeue an empty queue."
This reverts commit 1af7d4a894.
2018-06-19 15:49:45 +08:00
Guo Xiang Tan 41c1e1b302 FIX: `Discourse.keep_readonly_mode` does not work for multisite. 2018-06-19 15:44:08 +08:00
Guo Xiang Tan 1af7d4a894 FIX: Don't try to dequeue an empty queue. 2018-06-19 15:25:44 +08:00
Sam b8e5989201 correct rake db:create, which needs a defer DB object 2018-06-19 16:43:50 +10:00
Sam 5f64fd0a21 DEV: remove exec_sql and replace with mini_sql
Introduce new patterns for direct sql that are safe and fast.

MiniSql is not prone to memory bloat that can happen with direct PG usage.
It also has an extremely fast materializer and very a convenient API

- DB.exec(sql, *params) => runs sql returns row count
- DB.query(sql, *params) => runs sql returns usable objects (not a hash)
- DB.query_hash(sql, *params) => runs sql returns an array of hashes
- DB.query_single(sql, *params) => runs sql and returns a flat one dimensional array
- DB.build(sql) => returns a sql builder

See more at: https://github.com/discourse/mini_sql
2018-06-19 16:13:36 +10:00
Sam cc3fc87dd7 DEV: handle termination cleanly in autospec 2018-06-19 16:13:36 +10:00
Guo Xiang Tan c9feadf9ec FIX: Don't clear active connections in defer queue. 2018-06-19 12:45:16 +08:00
Guo Xiang Tan 34e4c8f573 FIX: `Discourse.keep_readonly_mode` spins a new thread each time it is called. 2018-06-19 10:24:08 +08:00
Guo Xiang Tan 6e97242bb9 Monkey patch in 7830a950ef 2018-06-19 09:45:48 +08:00
Jeff Wong 68e4e6a575 FIX: staged users are still tl0 but do not trigger spam if 1 week old. 2018-06-18 17:20:04 -07:00
Guo Xiang Tan 630b4570ef Add specs for `RateLimiter::LimitExceeded#description`. 2018-06-19 07:48:03 +08:00
Neil Lalonde 3725fd8345
Merge pull request #6002 from featheredtoast/trust-previously-staged-users
FIX: don't punish a user for being previously staged for spam flags.
2018-06-18 15:14:31 -04:00
Neil Lalonde 320cd9a19e UX: rate limiter message will say to wait "a few seconds" instead of 0 to 3 seconds 2018-06-18 14:14:47 -04:00
Joffrey JAFFEUX 913d97e780
fix prettier 2018-06-18 20:10:48 +02:00
Joffrey JAFFEUX 6f2c5ea1f2
increases loglevel to debug CI only failure 2018-06-18 19:25:54 +02:00
Blake Erickson 9963078dd1 Add to offical plugins list 2018-06-18 10:20:49 -06:00
Robin Ward e5c156b226 Add `characters-required` to official plugins list 2018-06-18 10:30:46 -04:00
Guo Xiang Tan c18b86d9b2 UX: Don't add light box for SVG images. 2018-06-18 17:11:06 +08:00
Jeff Wong 9e55767f6a FIX: don't punish a user for being previously staged for spam flags. 2018-06-15 12:25:25 -07:00
Joffrey JAFFEUX 03a7d532cf
DEV: introduces prettier for es6 files 2018-06-15 17:03:24 +02:00
Arpit Jalan c7ee70941e FEATURE: show category page options on wizard 'homepage' step 2018-06-15 19:11:41 +05:30
OsamaSayegh 2427c0a17c FIX: theme CSS should recompile when theme uploads change 2018-06-15 13:12:09 +10:00
Guo Xiang Tan c34100d1e7 Remove unused variable. 2018-06-15 07:45:51 +08:00
Sam Saffron 6123f61f5f seconds is not needed here 2018-06-14 20:53:24 +10:00
Sam 87fabdc2f3 FIX: correct pool reaper
This removes a freedom patch and replaces with a custom reaper thread
it also captures an issue where reaper would fail when connections where
empty
2018-06-14 18:22:02 +10:00
Sam 71aa20bd30 FIX: pool drainer to use Rails 5.2 implementation
old implementation did not reap abandoned connections
2018-06-14 15:54:48 +10:00
Sam 66982c7800 FIX: stop using Rails connection reaper in multisite
The Rails 5.2 connection reaper appears to be leaking threads
this is a quick fix to stop it, though we need to make sure we
never leak connection pools as well.
2018-06-14 12:49:30 +10:00
Robin Ward fd54c92a52 FEATURE: New site setting, whitelisted_link_domains
If provided, users who normally couldn't post links (say, due to a
low trust level), can post links to those specific hosts.
2018-06-13 16:11:22 -04:00
Robin Ward ae728702a6 Revert "Revert "Preload custom user fields when viewing flag queue""
This reverts commit 1bb12ee1b6.
2018-06-13 11:44:13 -04:00
Guo Xiang Tan 139d0813b4 Re-enable fast_pluck freedom patch. 2018-06-13 09:25:23 +08:00
Joshua Rosenfeld 1bb12ee1b6 Revert "Preload custom user fields when viewing flag queue"
This reverts commit 5bd1c5cc95.
2018-06-12 16:46:31 -04:00
Robin Ward 5bd1c5cc95 Preload custom user fields when viewing flag queue 2018-06-12 16:17:22 -04:00
Robin Ward e0096b0d1c Safety in case translations are missing root keys 2018-06-12 10:09:57 -04:00
Guo Xiang Tan 7c173265d5 FIX: Don't clear connections on the same process. 2018-06-12 13:06:25 +08:00
Guo Xiang Tan 646ed87aba Clear all connections once master recovers. 2018-06-12 12:13:59 +08:00
Guo Xiang Tan fd75e54793 Disconnect the pool during failover and fallback. 2018-06-12 11:09:19 +08:00
Guo Xiang Tan a7be68500d Better error reporting in PostgreSQL fallover thread. 2018-06-12 09:39:11 +08:00
Jeff Atwood 0dee603ffc
Merge pull request #5985 from featheredtoast/pm-participants-two-lines
FIX: PM participants listed inline
2018-06-11 18:33:15 -07:00
Guo Xiang Tan 805fd17b23 ActiveRecord in Rails 5.2 discards connection pools after fork. 2018-06-12 09:30:52 +08:00
Jeff Wong 4599cc8435 FIX: PM participants listed inline 2018-06-11 18:14:25 -07:00
Michael Brown 8d92c73aad
Merge pull request #5952 from Supermathie/remap_enhance
DbHelper.remap/find: add option to anchor at left/right of the column value
2018-06-11 15:15:17 -04:00
Guo Xiang Tan bfa0f71e2b FIX: `Discouse.keep_readonly_mode` incorrect extends expiry. 2018-06-12 00:21:29 +08:00
Guo Xiang Tan 2adae2a0b6 FIX: Be more aggressive in checking master when trying to fallback. 2018-06-12 00:09:15 +08:00
Régis Hanol 4d75535f9e Revert "Revert "Revert "Add discourse-group-tracker to official plugin list."""
This reverts commit d1dc8e4226.
2018-06-11 15:52:20 +02:00
Régis Hanol d1dc8e4226 Revert "Revert "Add discourse-group-tracker to official plugin list.""
This reverts commit 1a00aaa825.
2018-06-11 14:30:16 +02:00
Guo Xiang Tan c0b0c66a9e FIX: PostgreSQL fallback thread doesn't run server starts in readonly. 2018-06-11 15:23:58 +08:00
Guo Xiang Tan d06af14c26 FIX: Notify all processes to fallback when PostgreSQL recovers. 2018-06-11 15:10:28 +08:00
Guo Xiang Tan d192924876 FIX: Can't boot Discourse app with read-only PG connection take 2. 2018-06-11 13:25:51 +08:00
OsamaSayegh 93b1386fb2 REFACTOR: admin site settings controller specs to requests (#5966) 2018-06-11 12:48:09 +08:00
Guo Xiang Tan 5656e8f366 FIX: Can't boot Discourse with a read-only PG connection. 2018-06-11 12:29:23 +08:00
Guo Xiang Tan b91a3c12a5 Revert "Smoke test should wait up to 5 minutes before it fails"
This reverts commit 34d4712133.
2018-06-11 08:47:57 +08:00
Guo Xiang Tan e82d45b009 FIX: Ensure we have proper timeout for MiniRacer. 2018-06-11 08:41:04 +08:00
Neil Lalonde 4b2e42757d fix indent 2018-06-08 13:56:20 -04:00
Neil Lalonde b8cf0788c6 FIX: broken mailto href's in emails 2018-06-08 13:11:58 -04:00
Joffrey JAFFEUX d96c775833
enforces prettier 2018-06-08 17:38:29 +02:00
Gerhard Schlager 4ba910ac54 Update username only after successful user anonymization 2018-06-08 15:50:07 +02:00
Joffrey JAFFEUX 22c186a792
disables prettier enforcing for now 2018-06-08 15:44:00 +02:00
Joffrey JAFFEUX eedf7ffc4f
force install with sudo 2018-06-08 13:25:33 +02:00
Joffrey JAFFEUX bc7f16a406
forces install of prettier using npm 2018-06-08 13:22:36 +02:00
Joffrey JAFFEUX 3869a9d027
forces global install of prettier 2018-06-08 12:40:05 +02:00
Joffrey JAFFEUX ddade9c145
better log of yarn setup 2018-06-08 12:12:17 +02:00
Joffrey JAFFEUX bb920e9bb1
DEV: makes sure yarn is ran before docker:test 2018-06-08 12:04:53 +02:00
Joffrey JAFFEUX 174d392e5a
DEV: adds prettier (#5956)
Run `prettier --write "app/assets/stylesheets/**/*.scss" "plugins/**/*.scss"` after making sure you installed it with `yarn`

It's recommended to configure your editor to run prettier on file save.
2018-06-08 11:49:31 +02:00
Guo Xiang Tan 29c1f01494 Fix broken pool drainer after the upgrade.
See 6cd5cc375a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb (L467)

We think there is a leak at the moment because a discarded pool
belonging to the parent process shouldn't be present in the
forked process.
2018-06-08 13:19:07 +08:00
Sam 42847252a4 remove conditional code 2018-06-08 13:38:25 +10:00
Guo Xiang Tan 1a00aaa825 Revert "Add discourse-group-tracker to official plugin list."
This reverts commit e262cb07d4.
2018-06-08 10:51:16 +08:00