Commit Graph

4215 Commits

Author SHA1 Message Date
8e40c35eb8 FIX: 'have_uploads' scope should include all uploads without multisite 'upload_path' prefix 2019-04-15 01:54:55 +05:30
95ada3f190 FIX: save registration IP address for invited users 2019-04-13 13:04:25 +05:30
534d75310f FIX: Linting 2019-04-12 14:34:14 -04:00
a5d9afe397 FEATURE: Include a user's pending posts in the topic view
Also includes a refactor to TopicView's serializer which was not
building our attributes using serializers properly.
2019-04-12 14:25:12 -04:00
268d4d4c82 FEATURE: Multiple SCSS file support for themes (#7351)
Theme developers can include any number of scss files within the /scss/ directory of a theme. These can then be imported from the main common/desktop/mobile scss.
2019-04-12 11:36:08 +01:00
dcec256b9d Make 1gb warning a little less than 1gb (#7368)
When you have '1gb' RAM, this might be a little less than 1,000,000.
Let's not warn unless it's well under 1gb.
2019-04-11 16:44:29 -07:00
24ef4f7b2b Remove support for disable_jump_reply user setting (#7359) 2019-04-12 09:03:06 +10:00
dc703adad7 FEATURE: Add user preference for title counter mode (#7364) 2019-04-12 09:02:18 +10:00
6f7b6a3333 FIX: Disagree and Restore should not revert edits 2019-04-11 16:21:18 -04:00
331a809738 FEATURE: Display the reason for many reviewable items
Queued Posts and Users will now display a reason why they are in the
review queue.
2019-04-11 12:04:45 -04:00
d705dd8bb8 Update annotations. 2019-04-11 12:37:24 +08:00
cab83596ec FIX: Sites with SSO that required approval were not creating reviewables 2019-04-10 12:53:50 -04:00
5d99346740 FIX: Always allow us to reject users, even if they are deleted 2019-04-10 11:00:39 -04:00
3d545d66df FEATURE: Send user activation reminders. (#7280) 2019-04-10 16:53:52 +02:00
b0600e52b6 FIX: use 'freeze' method again to fix 'cant modify frozen string' error
8d5c90014268fa9e625930740db2a17e2d018784
2019-04-10 18:30:59 +05:30
536b90e0ef FEATURE: Support searching custom staff actions (#7346) 2019-04-10 09:53:17 -03:00
8d5c900142 DEV: add unique missing uploads index in post custom fields
https://review.discourse.org/t/feature-send-missing-post-uploads-stat-to-prometheus/2609/6?u=vinothkannans
2019-04-10 18:09:35 +05:30
d0fe42e2ef FIX: should look through posts for image markdown
Downloaded onebox images only included in the cooked HTML content. So we have to check 'post.cooked' instead of 'raw'. bfdd0fe64cc90707569a158b0dbdecedf3d03986
2019-04-10 13:52:35 +05:30
73663c2fdb FIX: should find records by sha1 only in Upload model 2019-04-09 18:48:49 +05:30
df7f37f10a FIX: web_crawlers had been mistakenly removed (#7342) 2019-04-09 09:26:22 +02:00
c82a929025 PERF: Add index_for_rebake_old to posts.
The index becomes smaller over time and is much faster.

Follow up to 4791d992dc484c8b81ec4250c65c097873e2f708.
2019-04-09 13:59:46 +08:00
28d117898f Update annotations. 2019-04-09 13:27:32 +08:00
f0bb492d24 Fix regression due to 914ada1c749425c4eb53b2d8338afa6b4ab3f3d4. 2019-04-09 09:47:11 +08:00
f5ac01253a FIX: use new changed method name and remove whitespaces 2019-04-09 02:25:26 +05:30
914ada1c74 DEV: convert scheduled job EnsurePostUploadsExistence into a rake task 2019-04-09 02:07:35 +05:30
2ae87a27fa make rubocop happy 2019-04-08 17:03:26 +05:30
f0f3deb32b PERF: Simplify query of UserStat#update_topic_reply_count.
For a user with alot of posts, we get a 25% speed up.
2019-04-08 17:48:19 +08:00
6525613b89 PERF: Use joins for Post.for_mailing_list instead of NOT IN.
Joining on the topics table and then filtering the topics against a large set of
ids is so much slower than doing a join on a sub query.
2019-04-06 07:58:55 +08:00
a7a5f90e20 Annotate models. 2019-04-05 17:13:12 +08:00
81a1bafe54 PERF: Speed up home page unread+new query
restructure query so it avoids ORs

It appears postgres is picking suboptimal indexes if too many ORs exist
despite how trivial the condition is.

This bypasses conditional in the query and evals them upfront.

On meta for my user this made a 10x perf difference.

This boils down to either having `OR u.admin` or not having `OR u.admin` in
the query.
2019-04-05 15:25:19 +11:00
5b837f620b correct unread resetting to handle nulls
Note, to avoid race conditions we are setting last_unread to 10 minutes ago
if there is nothing unread.

This is safer in case of in progress transactions
we don't want to lose unread for any window of time.
2019-04-05 13:42:41 +11:00
5f896ae8f7 PERF: Keep track of when a users first unread is
This optimisation avoids large scans joining the topics table with the
topic_users table.

Previously when a user carried a lot of read state we would have to join
the entire read state with the topics table. This operation would slow down
home page and every topic page. The more read state you accumulated the
larger the impact.

The optimisation helps people who clean up unread, however if you carry
unread from years ago it will only have minimal impact.
2019-04-05 12:44:45 +11:00
8af7237092 FIX: Only perform logic on create commits 2019-04-04 17:01:47 -04:00
df48c657fd FIX: Reviewable counts were not updating properly
Sometimes sidekiq is so fast that it starts jobs before transactions
have comitted. This patch moves the message bus stuff until after things
have comitted.
2019-04-04 16:07:34 -04:00
2055804e95 FIX: The option to delete replies was missing from the new review queue 2019-04-04 15:51:36 -04:00
6815f777f9 DEV: Remove unused method. 2019-04-04 14:19:39 +08:00
b3fb0a7039 FEATURE: ensure consistency of post uploads in cooked content 2019-04-04 02:23:28 +05:30
111a502231 FIX: Deleting Users should work nicely with Reviewable Users
"Rejecting" a user in the queue is equivalent to deleting them, which
would then making it impossible to review rejected users. Now we store
information about the user in the payload so if they are deleted things
still display in the Rejected view.

Secondly, if a user is destroyed outside of the review queue, it will
now automatically "Reject" that queue item.
2019-04-03 16:42:39 -04:00
828cdf3fea FIX: Protected method called, I'll fire myself now 2019-04-03 16:10:36 -04:00
82bddcbe51 FIX: Don't create two reviewable scores for a user 2019-04-03 16:03:32 -04:00
c1ea63bdc1 FIX: Reviewables should not be created for users until they are active
Conversely, if a user is deactivated the reviewable should automatically
be rejected.

Before this fix, if a user was not active they'd still show in the
review queue but without an "Approve" button which was confusing.
2019-04-03 15:25:00 -04:00
7b194743d7 FIX: clean up user export csv upload records in scheduled job (#7309) 2019-04-03 13:31:19 +05:30
b2dc65f953 FIX: on rebakes should not recreate quoted_posts records
Previously every rebake would remove and recreate records in this table
This caused created_at and updated_at to keep changing

Yes, I know the SQL is somewhat complex, but this makes quote extraction
more efficient cause we do everything in 2 round trips.

This also removes some concurrency protection we should no longer need
2019-04-03 16:17:15 +11:00
52c4711e80 DEV: Fix method that was incorrectly made private. 2019-04-03 12:37:50 +08:00
4037a2fd0b FIX: Restrict scope of old scheme upload migration.
Some sites have external URLs that don't even match `%/uploads/%' and
some sites surprise me with URLs that contains the default path when it
is a site in a multisite cluster. We can't do anything about those.
2019-04-03 11:56:41 +08:00
feb731bffd FIX: Regenerate optimized images instead of migrating from old scheme.
`OptimizedImage.migrate_to_new_scheme` was optimizing optimized images
which we don't need to do. Regnerating the optimized image is way easier.
2019-04-03 09:45:02 +08:00
d85240335b Annotate models. 2019-04-02 13:19:14 +08:00
d5a61ab167 FIX: Don't log a second pending action
If two people flagged the same post you'd get a "Pending" history event
logged which looked bad.
2019-04-01 17:07:47 -04:00
fdf4145d4b FEATURE: Delegated authentication via user api keys (#7272) 2019-04-01 13:18:53 -04:00
b375dcb14a DEV: Introduce parallel rspec testing
Adds the parallel_tests gem, and redis/postgres configuration for running rspec tests in parallel. To use:

```
rake parallel:rake[db:create]
rake parallel:rake[db:migrate]
rake parallel:spec
```

This brings the test suite from 12m20s to 3m11s on my macOS machine
2019-04-01 11:06:47 -04:00