Commit Graph

2925 Commits

Author SHA1 Message Date
Régis Hanol 6e5c59e5ec FIX: image orientation wasn't properly working 2017-06-22 16:53:49 +02:00
Régis Hanol a916f6b0c8 remove some warnings with already declared constants 2017-06-22 12:55:58 +02:00
Guo Xiang Tan 80e348d226 PERF: Speed up slow tests in our test suite.
Before

```
Finished in 7 minutes 23 seconds (files took 4.15 seconds to load)
7145 examples, 0 failures, 10 pending
```

After

```
Finished in 6 minutes 12 seconds (files took 4.41 seconds to load)
7145 examples, 0 failures, 10 pending
```
2017-06-22 11:23:31 +09:00
Guo Xiang Tan 4c98bd9d5f FIX: Can't update status_type of topic timers.
https://meta.discourse.org/t/topic-timers-internal-error-500/64805
2017-06-21 15:31:15 +09:00
Guo Xiang Tan dd85c1098b Remove comment that is no longer valid. 2017-06-21 14:10:30 +09:00
Guo Xiang Tan fa35137d3a PERF: Reduce allocations in `Emoji.unicode_replacements`.
```
MemoryProfiler.report { Emoji.unicode_replacements }.pretty_print
```

Before:

```
Total allocated: 2032131 bytes (30219 objects)
Total retained:  798059 bytes (10734 objects)

allocated memory by gem
-----------------------------------
   1270762  discourse/app
    690149  2.4.1/lib
     48764  activesupport-4.2.8
     11405  bootsnap-1.0.0
      5266  logster-1.2.7
      2473  hiredis-0.6.1
      2056  redis-3.3.3
       840  discourse/lib
       240  activerecord-4.2.8
       176  thread_safe-0.3.6
```

After:

```
Total allocated: 1715713 bytes (22449 objects)
Total retained:  797985 bytes (10737 objects)

allocated memory by gem
-----------------------------------
    957250  discourse/app
    690028  2.4.1/lib
     48764  activesupport-4.2.8
     11445  bootsnap-1.0.0
      2745  hiredis-0.6.1
      2624  redis-3.3.3
      1473  logster-1.2.7
       928  discourse/lib
       280  activerecord-4.2.8
       176  thread_safe-0.3.6
```
2017-06-20 13:50:37 +09:00
Guo Xiang Tan 40ef5c4f14 PERF: Reduce memory allocation by `Emoji.unicode_replacements`.
Calling `Emoji.tonable_emojis` fetches from the cache but creates
a giant array each time it is called.

```
MemoryProfiler.report { Emoji.unicode_replacements }.pretty_print
```

Before:

```
Total allocated: 16560770 bytes (246364 objects)
Total retained:  784793 bytes (10624 objects)

allocated memory by gem
-----------------------------------
  10224581  activesupport-4.2.8
   3504241  hiredis-0.6.1
   1449466  discourse/app
    679314  2.4.1/lib
    419592  discourse/lib
    226720  redis-3.3.3
     56680  activerecord-4.2.8
       176  thread_safe-0.3.6
```

After:

```
Total allocated: 2127703 bytes (30556 objects)
Total retained:  798099 bytes (10735 objects)

allocated memory by gem
-----------------------------------
   1270762  discourse/app
    690149  2.4.1/lib
    106977  bootsnap-1.0.0
     48764  activesupport-4.2.8
      5266  logster-1.2.7
      2473  hiredis-0.6.1
      2056  redis-3.3.3
       840  discourse/lib
       240  activerecord-4.2.8
       176  thread_safe-0.3.6
```
2017-06-20 13:10:44 +09:00
Guo Xiang Tan b5ec241716 FIX: Validate interpolation keys used in translation overrides.
https://meta.discourse.org/t/discobot-translation-missing-error/64429/6?u=tgxworld
2017-06-16 08:54:48 +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
Régis Hanol f77e6c8fc6 Merge pull request #4928 from jjaffeux/transform-native-emojis-to-names
Transforms native emojis to valid names
2017-06-14 15:43:09 +02:00
Joffrey JAFFEUX ab6086bce9 Transforms native skin toned emojis to valid names 2017-06-14 15:35:37 +02:00
Régis Hanol 04e175bc06 Merge pull request #4925 from jjaffeux/adds-tones-to-clear-cache
Makes sure we clear tonable_emojis cache
2017-06-14 14:56:41 +02:00
Joffrey JAFFEUX fa508042ff Makes sure we clear tonable_emojis cache 2017-06-14 11:11:02 +02:00
Guo Xiang Tan 2fdf9068eb FIX: Create notification for group users when group has been invited.
https://meta.discourse.org/t/inviting-a-group-to-a-message-does-not-trigger-a-notification-mail/50509
2017-06-14 14:53:49 +09:00
Joffrey JAFFEUX 299339a373 Fixes emoji name to code missing tones 2017-06-13 14:10:26 -04: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 54e8fb0d89 FEATURE: new 'allow_staff_to_upload_any_file_in_pm' site setting 2017-06-12 22:41:29 +02:00
Arpit Jalan b9c94aa234 FEATURE: add required user fields to invite accept form
UX: make "accept invitation" page consistent with sign up modal
2017-06-12 20:43:07 +05:30
Guo Xiang Tan e888369f51 UX: Don't send emails for discobot notifications. 2017-06-12 17:00:27 +09:00
Régis Hanol 038454bde2 FIX: always confirm emails when SSO says so 2017-06-08 01:05:33 +02:00
Guo Xiang Tan 5794ff53a1 FIX: Copy custom fields when moving first post of a topic.
https://meta.discourse.org/t/transfer-poll-votes-when-moving-a-topic-into-an-existing-one/63678
2017-06-07 19:04:48 +09:00
Joffrey JAFFEUX 2aae6cfdbe look for aliases in Emoji.lookup_unicode 2017-06-05 18:53:11 +02:00
Joffrey JAFFEUX 64336a8c75 Emoji 5.0 support 2017-06-05 14:06:23 +02:00
Guo Xiang Tan ac6c1acbed FIX: Groups that do not have any owners should not allow membership requests. 2017-06-05 10:02:37 +09:00
Guo Xiang Tan af3dc4e537 FIX: Publish group's categories to user when adding user to group.
https://meta.discourse.org/t/joining-a-group-doesnt-take-effect-unless-the-browser-is-hard-refreshed/57357/11?u=tgxworld
2017-06-02 17:38:14 +09:00
Sam a7fc93acac FIX: post mover not clearing reply_to_user_id 2017-06-01 18:00:14 -04:00
Guo Xiang Tan 2ee144c27f FEATURE: Add DiscourseEvent trigger when a user logs in.
* Also adds a event trigger when user logs in for the first time.
2017-06-01 17:44:49 +09:00
Guo Xiang Tan b0dd05fdc6 FIX: Inherit topic auto close when changing topic's category. 2017-05-31 17:40:21 +09:00
Sam aa24bcbcc9 correct annotation 2017-05-26 09:04:54 -04:00
Sam 0aed2533ac Revert unread optimisation, has too many edge cases 2017-05-26 09:04:13 -04:00
Guo Xiang Tan e57d2f5cb8 FIX: Don't do anything if avatar url returns an invalid status code. 2017-05-26 13:02:40 +08:00
Sam Saffron 7d59ff67b8 adjust qurey to include messages, once everything is read
then mark first_topic_unread_at to be current time
2017-05-25 18:40:32 -04:00
Robin Ward 39e1948174 FIX: If the error is 401 unauthorized or such, just do nothing 2017-05-25 15:42:05 -04:00
Sam 29fac1ac18 PERF: improve performance of unread queries
Figuring out what unread topics a user has is a very expensive
operation over time.

Users can easily accumulate 10s of thousands of tracking state rows
(1 for every topic they ever visit)

When figuring out what a user has that is unread we need to join
the tracking state records to the topic table. This can very quickly
lead to cases where you need to scan through the entire topic table.

This commit optimises it so we always keep track of the "first" date
a user has unread topics. Then we can easily filter out all earlier
topics from the join.

We use pg functions, instead of nested queries here to assist the
planner.
2017-05-25 15:07:30 -04:00
Robin Ward 0a08c18a14 FIX: Don't rate limit gravatar downloads 2017-05-24 13:54:26 -04:00
Robin Ward cdbe027c1c Refactor `FileHelper` to use keyword arguments. 2017-05-24 13:54:26 -04:00
Robin Ward 87ac758f05 FIX: Don't raise an error when the upload can't be retrieved 2017-05-24 13:54:26 -04:00
Guo Xiang Tan 08c36fa968 REFACTOR: Clean up some code associated with topic timers. 2017-05-22 18:10:29 +08:00
Guo Xiang Tan 604aaf8686 FIX: N+1 query in suggested topics list. 2017-05-22 18:05:38 +08:00
Robin Ward ed4b2b6d8d FIX: Don't incluide a trailing `<br>` in the bio excerpt 2017-05-18 16:40:07 -04:00
Régis Hanol 13e489b4ca replace the upload type whitelist with a sanitizer 2017-05-18 12:13:13 +02:00
Arpit Jalan 8e5b0c79ae FIX: allow images to be uploaded in wizard 2017-05-18 13:53:23 +05:30
Robin Ward f8c503186e FIX: If there's an error downloading, don't raise it 2017-05-17 12:38:18 -04:00
Sam 763f156d91 FIX: require re-activation if SSO changes email and updates it 2017-05-16 16:18:18 -04:00
Sam 4424fd81b8 add a tiny bit of extra protection 2017-05-16 16:08:42 -04:00
Sam 4b449914b8 FIX: admins could never remove self from messages 2017-05-16 16:06:24 -04:00
Neil Lalonde 7821400141 FEATURE: staff can set a timer to remind them about a topic 2017-05-16 14:49:50 -04:00
Sam e1dd543a93 FEATURE: allow users to select theme on single device 2017-05-15 12:48:16 -04:00
Sam 44d7fe89ed FIX: unescape emoji in pretty title
This makes emoji in title consistent, it is later escaped back when needed
2017-05-15 10:28:05 -04:00
Sam baf011cbf6 annotate models 2017-05-12 14:47:08 -04:00