Commit Graph

329 Commits

Author SHA1 Message Date
Sam Saffron 4cef3cd762 move fix to top of test 2017-09-01 13:12:47 -04:00
Sam Saffron 936582b8d1 Correct flaky spec
Can fail if the machine running tests has less that 10% free space
2017-09-01 13:10:01 -04:00
Vinoth Kannan 0fb7831749 FEATURE: Add placeholders to broken and large image files (#5113) 2017-09-01 10:26:13 -04:00
Leo McArdle 3986367f3f update pr based on review 2017-08-23 14:55:34 +01:00
Leo McArdle be1df3ba75 FIX: transfer posts by duplicated staged users to original 2017-08-22 09:58:51 +01:00
Erick Guan 6e59149a77 FIX: rebuild index when engine replaced (#5021) 2017-08-16 07:38:34 -04:00
Neil Lalonde 94d8f6d734 FIX: digest emails should not include posts that are still in the edit grace period 2017-08-14 12:47:33 -04:00
Guo Xiang Tan 793eccf6c5 FIX: Staged users were incorrectly created multiple times with same email. 2017-08-10 18:56:15 +09:00
Guo Xiang Tan 5012d46cbd Add rubocop to our build. (#5004) 2017-07-28 10:20:09 +09:00
Sam Saffron 045a2abcec FEATURE: remove the timecop gem
We should only have one way of mocking time, misuse of timecop
was causing build stability issues
2017-07-24 12:11:10 -04:00
Guo Xiang Tan fa09a02201 Fix specs. 2017-07-24 15:56:08 +09:00
Guo Xiang Tan 25448b70e4 Fix specs. 2017-07-24 15:52:56 +09:00
Guo Xiang Tan 7f1e74a272 Not sure how this spec actually worked in the past. 2017-07-24 14:13:23 +09:00
Sam Saffron 93f2c97266 simplify spec 2017-07-22 22:49:04 -04:00
Sam Saffron 687fbf5f09 simplify spec 2017-07-22 22:47:16 -04:00
Sam Saffron 7caf82f03c simplify spec 2017-07-22 22:01:11 -04:00
Sam 8ef4d6d812 this was failing erratically 2017-07-21 17:14:06 -04:00
Leo McArdle ddc0134b48 add DiscourseEvent triggers necessary to update a user's permissions before they're notified 2017-07-21 11:03:54 -04:00
Sam Saffron d0c5205a52 Feature: Change markdown engine to markdown it
This commit removes the old evilstreak markdownjs engine.

- Adds specs to WhiteLister and changes it to stop using globals
    (Fixes large memory leak)
- Fixes edge cases around bbcode handling
- Removes mdtest which is no longer valid (to be replaced with
    CommonMark)
- Updates MiniRacer to correct minor unmanaged memory leak
- Fixes plugin specs
2017-07-17 11:41:34 -04:00
Guo Xiang Tan 13f3de4bf6 Nuke all `SiteSetting.stubs` from our codebase. 2017-07-07 15:09:14 +09:00
Guo Xiang Tan e92acb4c40 FIX: `Jobs::PullHotlinkedImages#is_valid_image_src` returns true for a generic string. 2017-07-06 18:31:15 +09:00
Régis Hanol d6c63cc5b2 FIX: user's default group should only be set once
Setting a user's default groups based on their email address should only be done once, ie. when they confirm their email address.
Previously we were doing this everytime we'd save a user record 🤷
2017-06-14 19:20:18 +02:00
Sam 826f332766 Merge pull request #4901 from jjaffeux/emoji-5.0
Emoji next
2017-06-13 11:12:41 -04:00
Régis Hanol 5d63a7f4a6 FIX: pull hotlinked images even when they have no extension 2017-06-13 13:27:05 +02:00
Régis Hanol e8f0771dc9 FIX: the 'clean_up_uploads' jobs would delete images used in site settings
when they were entered using absolute URLs, with the CDN or simple a different format than the one used in the database
2017-06-07 22:53:15 +02:00
Vinoth Kannan 209383faab FEATURE: pull onebox images 2017-06-06 18:51:58 +05:30
Joffrey JAFFEUX 09d34b7642 emoji images are now v5 not v3
TODO: we should not hardcode this
2017-06-05 16:10:36 +02:00
Guo Xiang Tan 56f98de7b2 Use webmock to stub external web requests. 2017-05-26 15:19:09 +08:00
Robin Ward 36e477750c FIX: Use same code path for downloading images 2017-05-23 14:51:30 -04:00
Guo Xiang Tan 08c36fa968 REFACTOR: Clean up some code associated with topic timers. 2017-05-22 18:10:29 +08:00
Neil Lalonde 7821400141 FEATURE: staff can set a timer to remind them about a topic 2017-05-16 14:49:50 -04:00
Robin Ward bd0bb879e5 FIX: Don't count likes from system users in the new user of the month 2017-05-15 13:14:32 -04:00
Guo Xiang Tan 41711e53b7 Fix typo. 2017-05-12 10:31:31 +08:00
Guo Xiang Tan 8eecd42856 FIX: Delete topic timer after completion. 2017-05-12 10:28:51 +08:00
Neil Lalonde 55b61e9bea rename topic_status_update to topic_timer 2017-05-11 18:27:53 -04:00
Neil Lalonde 1019bbda46 FEATURE: set a timer to delete a topic 2017-05-11 12:52:29 -04:00
Robin Ward 3ade46de0b FIX: Don't send system message for new user of the month if disabled 2017-05-11 11:33:16 -04:00
Robin Ward 4db76796b9 FEATURE: Setting to poll feeds more frequently 2017-05-10 14:30:12 -04:00
Robin Ward 4f6e5fed2a We don't need to raise an error when no post is present. Just noop. 2017-05-08 15:08:29 -04:00
Guo Xiang Tan 71a266b673 Remove daily mailing mode option as it doesn't scale.
https://meta.discourse.org/t/daily-updates-option-for-mailing-list-mode/45029/14?u=tgxworld
2017-05-05 12:21:50 +08:00
Arpit Jalan 75300b6356 improve specs 2017-05-03 17:48:33 +05:30
Arpit Jalan 86f1cc8c92 FIX: don't apply max_emails_per_day_per_user on critical emails 2017-05-03 17:07:39 +05:30
Arpit Jalan cdce060a38 FIX: don't apply max emails per day per user to forgot password 2017-05-03 14:02:37 +05:30
Robin Ward f05f1a24d3 Change Anniversary badge to be multiple grant, once per year 2017-04-28 14:22:54 -04:00
Guo Xiang Tan 85d9342ff0 Merge pull request #4836 from tgxworld/fix_clean_up_staged_users_job
FIX: Clean up unused staged users job not completing.
2017-04-27 15:41:46 +08:00
Robin Ward bf9c4a7828 FEATURE: secure_email site setting to prevent data going out in email 2017-04-26 13:05:56 -04:00
Guo Xiang Tan daa97c40ce FIX: Clean up unused staged users job not completing. 2017-04-26 10:51:36 +08:00
Neil Lalonde 3835e16cf7 FIX: New implementation of the "notify about flag after" setting. Only notify about new flags since the last notification. Send a private message to staff. Mention the 3 most active moderators in the message so they get notification emails. 2017-04-19 16:17:45 -04:00
Guo Xiang Tan 04016f0dec Support Ruby 2.4. 2017-04-15 12:29:00 +08:00
Guo Xiang Tan 5a57278a8e Fix build. 2017-04-11 21:37:57 +08:00
Guo Xiang Tan 73180c8a19 FIX: Private message can be set to publish in the future. 2017-04-11 20:44:25 +08:00
Guo Xiang Tan aadf4805a5 FIX: Topic status update not being deleted once it has been executed. 2017-04-11 10:32:13 +08:00
Guo Xiang Tan 690d2f4bd3 UX: Publish topic changes when topic is published. 2017-04-07 15:32:00 +08:00
Guo Xiang Tan 48a9860f07 FIX: Publish topic to a category should unlist it as well. 2017-04-07 13:58:52 +08:00
Guo Xiang Tan ad44d2a400 Merge pull request #4790 from tgxworld/add_publish_to_topic_status_update
FEATURE: Allow admins to schedule a topic to be published in the future.
2017-04-04 11:18:53 +08:00
Guo Xiang Tan f4758a4c4d FEATURE: Allow admins to schedule a topic to be published in the future. 2017-04-04 11:16:05 +08:00
Robin Ward ebe232da47 Weigh staff votes more for New User of the Month badges 2017-04-03 16:52:31 -04:00
Robin Ward a13a8dc96c FIX: Safeguard to not award NewUserOfTheMonth if it hasn't been a month 2017-04-03 13:26:51 -04:00
Robin Ward 3d64f33d40 Require at least two likes to get the "New User of the Month" badge 2017-04-03 13:03:28 -04:00
Robin Ward b189486fc0 We can do a lot less work in the test since we eased the criteria 2017-04-03 12:15:24 -04:00
Robin Ward e4b1376146 Change New User of the Month Badge to use trust level rather than age 2017-03-31 16:56:58 -04:00
Robin Ward a8d3779f0b Update New User of the Month badge to require 4 posts in 2 topics 2017-03-31 16:52:00 -04:00
Robin Ward fc7fa4c0ad Rename "Rookie of the Month" to "New User of the Month" 2017-03-31 16:30:30 -04:00
Robin Ward 893e93dfbe New badge, Rookie of the Month, for two new high quality users. 2017-03-31 15:06:31 -04:00
Guo Xiang Tan 34b7bee568 FEATURE: Allow admin to auto reopen at topic.
* This commit also introduces a `TopicStatusUpdate`
  model to support other forms of deferred topic
  status update in the future.
2017-03-31 11:14:18 +08:00
Guo Xiang Tan 7cf0f39066 Require `Sidekiq::Testing` in rails helper. 2017-03-29 11:10:25 +08:00
Arpit Jalan df246c79b6 FEATURE: add user profile fields in user list export 2017-03-21 15:51:52 +05:30
Erick Guan cfbfea0596 FEATURE: Allow easier customization to the web hook event serialization. 2017-03-16 10:09:05 +08:00
Guo Xiang Tan 685c26961f Fix randomly failing specs. 2017-03-14 16:28:05 +08:00
Guo Xiang Tan 6312b8b7e4 Fix failing specs. 2017-03-14 14:58:22 +08:00
Guo Xiang Tan 1a7e954e09 FIX: Store custom emojis as uploads.
* Depending on a hardcoded directory was a flawed design
  which made it impossible to debug when custom emojis go
  missing.
2017-03-14 13:07:18 +08:00
Régis Hanol 23b06d2895 FIX: should not try to send digest to users who reached the bounce threshold 2017-03-08 19:19:11 +01:00
Régis Hanol cf8bc4483f FIX: always send critical emails even when bounce score threshold has been reached 2017-03-08 10:06:16 +01:00
Arpit Jalan d5bcc70e9c FIX: grant trust level when bulk adding users to group 2017-03-06 14:39:53 +05:30
Régis Hanol ba115480ba FIX: wasn't extracting links to quoted posts 2017-02-06 14:45:04 +01:00
Arpit Jalan a525563eea Optimize spec for ProcessPost job 2017-01-31 14:10:56 +05:30
Arpit Jalan 19f7beaa2c FIX: topic links were getting dropped when post is rebaked 2017-01-30 14:55:53 +05:30
Neil Lalonde 7ead3e1f18 fix failing specs 2017-01-27 16:17:10 -05:00
Leo McArdle b60e9b7330 FIX: Handle img src starting with "//" in pull_hotlinked_images job 2017-01-16 10:50:07 +00:00
Arpit Jalan 7a1ff59822 FIX: PM email to suspended member was broken 2017-01-05 13:58:14 +05:30
Guo Xiang Tan 076a08d8e1 FIX: Unactivated users should not be automatically added into groups as well. 2016-12-21 18:15:01 +08:00
Guo Xiang Tan 7228081820 FIX: Automatic group membership should not add staged or unactivated users. 2016-12-21 18:04:26 +08:00
Guo Xiang Tan 18f400e652 Remove RSpec given. 2016-12-14 10:29:22 +08:00
Régis Hanol 664feca199 FIX: don't send emails from muted users in mailing list mode 2016-12-12 15:28:26 +01:00
Guo Xiang Tan 9a800107cb FIX: Associate category logo and background to uploads record. 2016-12-12 17:37:28 +08:00
Arpit Jalan ce974da9e5 FIX: simplify CSV file upload 2016-12-05 14:09:08 +05:30
Sam ac2c035856 FIX: stop raising exceptions when a post goes missing 2016-11-08 14:51:56 +11:00
Guo Xiang Tan f03d9cad06 PERF: `NOT IN` query is really inefficient for large tables. 2016-11-02 13:09:18 +08:00
Kiril Staikov aee943486a FEATURE:'No Echo' option for mailing list mode.
Mailing list mode now includes the 'no echo' option: to only receive emails of posts not created
by you.  If you reply to an email thread in mailing list mode, your reply will not then be echoed
back to you in a duplicate email by the system.
2016-10-19 13:14:36 -04:00
Robin Ward af83c8dc14 Upload Logos Step 2016-09-22 09:52:19 -04:00
Erick Guan 9ce61b4586 FEATURE: Webhooks. 2016-09-05 18:44:00 +08:00
Régis Hanol 7db2083d45 FIX: 'cancel_scheduled_job' was deleting all jobs in multisite 2016-08-12 13:10:52 +02:00
Régis Hanol 51322a46b3 FEATURE: retry processing incoming emails on rate limit 2016-08-08 22:28:27 +02:00
James Kiesel c2819e99f4 Don't halt notification emails for those on daily mailing list mode 2016-08-03 12:29:38 -04:00
Régis Hanol c591429868 FIX: don't destroy uploads in queued posts and drafts 2016-08-01 18:35:57 +02:00
Régis Hanol 17890f95a1 FIX: don't send emails to mailing_list users when bounce threshold is reached 2016-07-05 12:20:07 +02:00
Guo Xiang Tan bd07658a37
PERF: Split queries when cleaning uploads.
This reduces the number of scans that the db has to do in the query
to fetch orphan uploads. Futheremore, we were not batching our
records which bloats memory.
2016-07-04 16:34:32 +08:00
Sam 813fcebdd1 FIX: email_always was not respected correctly
In the past email always meant, email me even if active UNLESS I read post

Now emails always means, always, even if I read the post
2016-07-01 11:22:07 +10:00
Régis Hanol 214f5bff5c don't send more than 1 reply per day to auto-generated emails 2016-06-28 16:42:05 +02:00
Régis Hanol e9a293beeb FIX: clean up uploads job 2016-06-20 22:05:41 +02:00
Arpit Jalan 7b205ebba4 FEATURE: customize invite email message 2016-06-06 20:15:30 +05:30
Guo Xiang Tan cb5be1fe8f
Upgrade rspec to 3.4.0. 2016-05-30 11:38:38 +08:00
Sam efc45aa704 correct specs 2016-05-27 12:35:22 +10:00
James Kiesel feffe23cc5 FEATURE: More granular mailing list mode (#4068)
* Rearrange frontend to account for mailing list mode

* Allow update of user preference for mailing list frequency

* Add mailing list frequency estimate

* Simplify frequency estimate; disable activity summary for mailing list mode

* Remove combined updates

* Add specs for enqueue mailing list mode job

* Write mailing list method for mailer

* Fix linting error

* Account for stale topics

* Add translations for default mailing list setting

* One query for mailing list topics

* Fix failing spec

* WIP

* Flesh out html template

* First pass at text-based mailing list summary

* Add user avatar

* Properly format posts for mailing list

* Move make_all_links_absolute into Email::Styles

* Apply first_seen_at to user

* Send mailing list email summary hourly based on first_seen_at

* Branch and test cleanup

* Use existing mailing list mode estimate

* Fix failing specs
2016-05-21 15:17:54 +02:00
Guo Xiang Tan e3e31441b8
FIX: Random Redis connection timeout failure in Travis. 2016-05-18 10:42:40 +08:00
Guo Xiang Tan b68860ee28 FIX: Do not send email when user of the post has been deleted. (#4228) 2016-05-17 17:42:15 +02:00
Guo Xiang Tan 4e59ec5a60
Fix the build. 2016-05-16 18:22:03 +08:00
Régis Hanol aa5ea719ee fix build 2016-05-06 19:50:44 +02:00
Arpit Jalan 9427e0c732 FIX: bootstrap mode should not amend setting that is not in default state 2016-05-04 16:46:46 +05:30
Régis Hanol 8e611ec7a1 FEATURE: handle bounced emails 2016-05-02 23:15:32 +02:00
Arpit Jalan 74b3807f60 FEATURE: new bootstrap mode settings for brand new Discourse community (#4193)
* FEATURE: new bootstrap mode settings for brand new Discourse community

* new SiteSetting.set_and_log method
2016-04-26 13:08:19 -04:00
Guo Xiang Tan b4e0c5afe0
FIX: Fetch stats if it has not been cached. 2016-04-21 14:50:25 +08:00
Guo Xiang Tan f95cefd09a FEATURE: Add POP3 timeout error only after 3 failures in a row. 2016-04-14 08:55:19 +08:00
Guo Xiang Tan 5734c7f3f3 FIX: Don't send rejection mailer to bounced emails. 2016-04-07 22:21:17 +08:00
Sam c095304d6d FEATURE: limit daily emails per user to 100 per day via site setting
- controlled via max_emails_per_day_per_user, 0 to disable
- when limit is reached user is warned
2016-03-23 15:08:48 +11:00
Robin Ward 5771d2aee2 SECURITY: Support for confirm old as well as new email accounts 2016-03-08 14:52:22 -05:00
Guo Xiang Tan f89e9024ba FIX: Topic and Post may be `nil`. 2016-02-24 16:27:28 +08:00
Neil Lalonde e8d837269b FEATURE: pending flags reminder is sent as a group message to staff instead of sending an email to the contact email site setting. 2016-02-19 15:21:18 -05:00
Sam 3829c78526 PERF: shift most user options out of the user table
As it stands we load up user records quite frequently on the topic pages,
this in turn pulls all the columns for the users being selected, just to
discard them after they are loaded

New structure keeps all options in a discrete table, this is better organised
and allows us to easily add more column without worrying about bloating the
user table
2016-02-17 18:08:25 +11:00
Régis Hanol 460665895c properly name purge emails/email logs site settings 2016-02-08 22:18:52 +01:00
Régis Hanol ac863bab91 FEATURE: new 'suppress_email_logs_after_days' site setting 2016-02-08 18:47:35 +01:00
Régis Hanol ea0e63b150 FIX: handle cases where we only pass the notification type rather than the notification id when sending user email 2016-02-05 20:07:30 +01:00
Régis Hanol 7d992cb4c5 FIX: sending emails to mailing list subscribers wasn't working 2016-02-03 19:27:58 +01:00
Régis Hanol 12051f79a8 FIX: don't send empty email notifications for small_actions 2016-02-01 19:12:10 +01:00
Régis Hanol 96380bfd38 FIX: only create 1 email_log when an email is sent 2016-01-29 16:49:49 +01:00
Régis Hanol 3390fa56d0 improve the specs to check we properly update 'user.last_emailed_at' 2016-01-28 19:31:17 +01:00
Régis Hanol d51019ee53 FIX: *always* create an EmailLog whenever we run the UserEmail job
There were actually 2 bugs:

1/ Calling '.try(:key)' on a hash doesn't work. So EmailLogs were never associated to a user.

2/ Turns out that we update the 'user.last_emailed_at' whenever we create an EmailLog (in the 'after_create' callback).
So we need to always create an EmailLog (whenever the email is sent or skipped).
2016-01-28 19:01:35 +01:00
Sam 1bb485fca5 FIX: when a user got multiple replies to a topic, emails were missing 2016-01-27 12:20:08 +11:00
Régis Hanol 3083657358 FEATURE: better email in support
FEATURE: new incoming_email model
FEATURE: infinite scrolling in emails admin
FEATURE: new 'emails:import' rake task
2016-01-19 00:57:55 +01:00
Régis Hanol 737c606710 FIX: 'cancel_scheduled_job' wasn't working due to sidekiq upgrade 2016-01-13 09:08:26 +01:00
Régis Hanol 51b2279af0 fix the build 2015-12-16 01:31:19 +01:00
Andy Waite 3e50313fdc Prepare for separation of RSpec helper files
Since rspec-rails 3, the default installation creates two helper files:
* `spec_helper.rb`
* `rails_helper.rb`

`spec_helper.rb` is intended as a way of running specs that do not
require Rails, whereas `rails_helper.rb` loads Rails (as Discourse's
current `spec_helper.rb` does).

For more information:

https://www.relishapp.com/rspec/rspec-rails/docs/upgrade#default-helper-files

In this commit, I've simply replaced all instances of `spec_helper` with
`rails_helper`, and renamed the original `spec_helper.rb`.

This brings the Discourse project closer to the standard usage of RSpec
in a Rails app.

At present, every spec relies on loading Rails, but there are likely
many that don't need to. In a future pull request, I hope to introduce a
separate, minimal `spec_helper.rb` which can be used in tests which
don't rely on Rails.
2015-12-01 20:39:42 +00:00
Neil Lalonde 523138f1fd FEATURE: add setting pending_users_reminder_delay to configure when to send reminders to moderators about user approvals based on how long new users have been waiting 2015-11-20 16:06:07 -05:00
Neil Lalonde 5597957cc6 FIX: don't send repeat notifications to moderators about the same pending approval users 2015-11-20 16:06:07 -05:00
Régis Hanol acecfeb37f Add 'staged' boolean to User 2015-11-06 19:19:13 +01:00
Arpit Jalan 700c005c26 PERF: optimize export user list CSV queries 2015-11-02 13:15:58 +05:30
Régis Hanol b9a9a91335 FIX: couldn't set 'never' for the default email digest frequency setting 2015-09-14 10:36:25 +02:00
Régis Hanol bef80633b1 FEATURE: global admin override of most of the user preferences 2015-08-21 20:39:21 +02:00
Sam a246e7c9c0 fix invalid spec 2015-08-14 16:28:29 +10:00
Régis Hanol 15418f3d44 FEATURE: new 'backup_frequency' site setting 2015-08-07 17:34:58 +02:00
Sam e3d6c476f5 Merge pull request #3593 from tgxworld/cache_results_on_about_page
Cache results on about page
2015-07-21 10:04:51 +10:00
Guo Xiang Tan b0ea6764e0 PERF: Cache About#stats. 2015-07-20 22:45:05 +08:00
Arpit Jalan 7a1694f1ac FEATURE: add more data in user list export 2015-07-15 11:38:48 +05:30
Neil Lalonde 77595bcaa9 FEATURE: notify by email when there are posts from new users waiting to be reviewed 2015-06-18 15:47:35 -04:00
Arpit Jalan b33654ac31 Remove site setting stubbing (Round 1) 2015-06-03 15:44:00 +05:30
Luke Granger-Brown 9f9825bb6b FIX: don't send emails to anonymous users
Also changes behaviour of real to not return anonymous users.

This means user counts will no longer include them, and the
mailing list system will ignore them even if they somehow end up
with the feature turned on.
2015-05-11 00:56:34 +01:00
Neil Lalonde 85320f919b FEATURE: user list csv includes approved, suspended_at, suspended_till, blocked 2015-04-22 12:40:12 -04:00
Arpit Jalan e6df97f01d FIX: add email reply error message for topic not getting created in restricted category 2015-04-10 17:11:52 +05:30
Régis Hanol 1a3fa52cde fix broken build (cc @riking) 2015-04-06 12:12:27 +02:00
Sam c6a5081763 FEATURE: reorder participants in topic so always chronological
FEATURE: tie breaker for same number of posts is last post date
UX: highlight for latest poster when it is OP
2015-04-06 17:27:05 +10:00