Граф коммитов

23 Коммитов

Автор SHA1 Сообщение Дата
Jesús Espino
7fe6c94eda Adding Upgrade to Enterprise version feature (#14539)
* Adding Upgrade to Enterprise version feature

* Addressing PR review comments, and adding some minor improvements

* Add tests file

* Addressing PR comments

* fix linter checks

* Storing and exposing the upgraded from TE info

* Fix showing errors on mac

* A more appropiate status code for not-supported upgrade

* Fixing tests

* Handling permissions errors

* More server logging around upgrade failures

* Apply text changes suggested from code review

Co-authored-by: Eric Sadur <57730300+esadur@users.noreply.github.com>

* Address PR review comments

* Only allow to restart the system after an upgrade

* Verify file signature before upgrade

* Adding limit to the downloaded file

* Simplifying the upgrade binary process with backup in memory

* Fixing backup/restore mechanism for the binary file

* Improve file permissions handling

* Askin the permissions for the right place (the parent directory)

* Fixing tests

* Addressing PR review comments

* Fix license headers

* Fixing retry layer

* Making it work on windows builds

* Adding license header

* Fixing 2 tests

* Fixing tests that need UpgradeFromTE System key mock

* Extracting i18n translation

* Apply suggestions from code review

Co-authored-by: Eric Sadur <57730300+esadur@users.noreply.github.com>

* Improving how the errors are written

* Fixing another error text

* Removing unneeded translation

* Fixing upgrade status strings

* Update i18n/en.json

Co-authored-by: Eric Sadur <57730300+esadur@users.noreply.github.com>

* Fixing tests

Co-authored-by: Eric Sadur <57730300+esadur@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-08-21 20:23:04 +02:00
Harrison Healey
f62493145a MM-24386/MM-24465 Enable link previews and full push notifications by default (#14565)
* MM-24386 Update default push notification contents to full

* MM-24465 Enable link previews by default

* Fix a unit test relying on the old default
2020-05-20 09:23:13 -04:00
Eli Yukelzon
7800116429 MM-23093 Implement Server Setup telemetry - server configuration (#14374)
* added advanced first day diagnostics reporting

* typo

* config corrected

* defaults

* moved from config to system db table

* missing file

* added error handling

* tests

* typos

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-30 18:18:12 +03:00
Agniva De Sarker
583daeb132 MM-23547: remove redundant JSON parsing in push notifications (#14181)
Automatic Merge
2020-04-08 08:38:57 -07:00
Agniva De Sarker
b754fdb3e1 MM-23460: Reuse a single HTTP client across all push notifications (#14122)
Before this, for every single request we would create a new http.Client
from scratch. This was costly because every new client has internal
TCP connections which it reuses.

Therefore, originally, beyond a throughput of 800-1200 rps with a
concurrency of 50, beyond which it would run out of file descriptors.

Now it can support upto 8000-10000 rps.
An improvement by a factor of 10.

Throughput numbers:
BenchmarkPushNotification
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 11445.091601 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9190.761518 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 8334.394764 reqs/s
BenchmarkPushNotification-8   	     219	   5999304 ns/op	 3369224 B/op	   42127 allocs/op
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9590.399780 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9347.137463 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9053.784250 reqs/s
BenchmarkPushNotification-8   	     223	   5522636 ns/op	 3368470 B/op	   42034 allocs/op
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 10250.783365 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9123.292899 reqs/s
    BenchmarkPushNotification: notification_push_test.go:1478: throughput: 9173.553180 reqs/s

This is the aggregate count using benchstat.
The number is for a single run of sending 50 requests.

name                time/op
PushNotification-8  5.61ms ± 7%

name                alloc/op
PushNotification-8  3.36MB ± 1%

name                allocs/op
PushNotification-8   42.0k ± 1%

Tested on a machine with ulimit -n = 4096.
2020-03-28 09:33:38 +05:30
Agniva De Sarker
3e2175f897 MM-23276: Refactor push notifications (Part 1) (#14059)
Automatic Merge
2020-03-18 09:58:59 -07:00
Ben Schumacher
5a34ec4793 Fix app error messages (#13852)
* Summary
Fixing inconsistencies of the app_error messages. Now all end with a 
period and there is the same user experience all over the system. 

We agreed on this change on the community server a while ago and I just 
came around finally doing it.


Ticket Link
N/A

Checklist
 Includes text changes and localization file (.../i18n/en.json and 
.../webapp/i18n/en.json) updates

* Update i18n/en.json

Approving changes

Co-Authored-By: Jason Blais <13119842+jasonblais@users.noreply.github.com>

* Update i18n/en.json

Approving changes

Co-Authored-By: Jason Blais <13119842+jasonblais@users.noreply.github.com>

* Update i18n/en.json

Approving changes

Co-Authored-By: Jason Blais <13119842+jasonblais@users.noreply.github.com>

* Fix test failures due string differences

Co-authored-by: Jason Blais <13119842+jasonblais@users.noreply.github.com>
Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-03-04 20:14:23 +01:00
Jesús Espino
7035e09fe9 Adding changes to separate unit tests and integration tests (#13670)
* Introducing unit (not integration) tests for the app layer

* Initial support for unit tests at the API

* Adding unit tests support to the store layer

* Add unit tests support in commands

* Adding last tests needed for run unit tests properly

* Fixing govet

* Removing some duplication

* Fixing tests

* Fixing tests

* Not compiling test helpers with the main module for api

* Revert "Not compiling test helpers with the main module for api"

This reverts commit 36a199bbe0f7503f665f5d6c7b41c53aabc2e54f.

* Fixing tests

* Fixing unit tests

* More consistency between api4/apiteslib.go and app/helper_test.go

* Renaming things to make more obvious the new Setup functions purpose

* Reverting change in go.sum

* Start with empty mock for app layer

* Start with empty mock for api layer

* Start with empty mock for web layer

* Renaming SetupWithStoreMockConfig to SetupConfigWithStoreMock

* Fixing tests on web package

* Removing unnecesary function
2020-03-02 08:13:39 -08:00
Mario de Frutos Dieguez
682a1d5d15 Avoid panic when push messages are empty or nil (#13751) 2020-01-29 10:08:27 +01:00
Agniva De Sarker
f75c8c7c9f MM-20225: Fix notification badge count for All Activity (#13353)
When push notification setting was selected to "All Activity", we were
just sending the unread count for the channel from where the message was sent
and not for all channels.

After discussion with @enahum and @migbot, we decided to keep the badge count
to only refer to mentions and not unread posts.

Therefore, we only take the unread count for the user irrespective of the
notify_props settings.

Updated the tests to reflect that.

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-01 13:46:51 +05:30
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
Miguel de la Cruz
2259b7f2a8 [MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths

* Fixes after merge

* Fix i18n checker error
2019-11-28 14:39:38 +01:00
Elias Nahum
3e9cd464de MM-20347 Move ID Loaded Push Notifications to E20 (#13185)
* Move ID Loaded Push Notifications to E20

* Fix model tests
2019-11-21 19:35:19 -03:00
Harrison Healey
de913e7537 Merge branch 'master' into mark-as-unread 2019-11-19 09:45:03 -05:00
Miguel Alatzar
d44d563ef3 [MM-16232] ID loaded push notifications (#13137)
* Update BuildPushNotificationMessage (#12974)

* Update BuildPushNotificationMessage

* Included Category, Version, and Type

* Remove unnecessary function args

* [MM-16232] Build and return fetched notification (#13085)

* Build and return fetched notification

* Remove check on PushNotificationContents

* Ran i18n-extract

* Get UserId from session

* Re-add ReturnStatusOK

* Remove UserId from PushNotificationAck

* Always include channel name

* [MM-16232] Return after writing response and add default message (#13127)

* Return after writing response and add default message

* Include channel ID as well

* Localize default message

* Fix i18n
2019-11-18 15:42:51 -08:00
Harrison Healey
66da2bab2b MM-18463 Added update_badge notification when marking a channel as unread (#12499)
* MM-18463 Added update_badge notification when marking a channel as unread

* Address feedback
2019-10-07 09:58:39 -04:00
Harrison Healey
e6f67c664c MM-17071 Add mention counting when marking a post as unread (#11966)
* Add different types for different mentions

* Remove redundant THREAD_ANY and THREAD_ROOT constants

* Make PostStore.Get return thread in order

* MM-17071 Add initial version of countMentionsFromPost

* MM-17071 Refactor comment mention counting

* MM-17071 Use mention counting when marking post as unread

* Fix shadowing in tests

* Remove repeated check of user count

* Refactor code using MentionType

* Update comments around -1 return value

* Move inner functions out of countMentionsFromPost

* Remove preconditions check as separate test case

* Update comments

* Add User.GetMentionKeys

* Revert "Make PostStore.Get return thread in order"

This reverts commit 22aa010cee359655fe75e1dc899cf0ffb0943c2a.

* Fix tests

* Fix merge conflict

* Add store.MentionAllPosts
2019-09-19 10:10:10 -04:00
Rajat Varyani
2b18ebe2cf [MM-18319] Replace t.Fatal with assert.Equal (#12082) 2019-09-09 13:32:30 +02:00
Miguel Alatzar
614ca90ca2 [MM-18058] Use GetAnyUnreadPostCountForChannel for NotifyProps.push == all (#11979)
* Use GetAnyUnreadPostCountForChannel for NotifyProps.push == all

* Extract out msg building and add unit test
2019-08-30 15:00:28 +02:00
Sheshagiri Rao Mallipedhi
446c6d452e MM-12795: remove @ from push notifications (#10298)
* remove @ from push notifications

* prepend @ when display name is set to username

* fix @ in username

* fix username getting prefixed in push notifications
2019-04-23 12:20:19 -04:00
Shreyansh Chouhan
39ceaa3e86 [MM-13833] Configured unit tests to log through t.Log (#10272)
* Rerouted the unit test logs through t.Log

* resolving merge confilvts

* Update testing.go

* Update helper_test.go

* Added godocs for NewTestingLogger

* Added go docs for NewTestingLogger

* Resolving conflicts
2019-02-14 13:52:11 -04:00
Jesús Espino
8c56f52d17 Migrate notification_push_test to table testing (#9195) 2018-07-31 20:29:57 +02:00
Jesús Espino
08e54ed824 Split notifications file into different files (#9164) 2018-07-28 19:20:44 +02:00