Commit Graph

13015 Commits

Author SHA1 Message Date
Agniva De Sarker
66731e2740 MM-29980: Optimize profilesInChannels cache to fast path (#16116)
* MM-29980: Optimize profilesInChannels cache to fast path

We add one more message type to the fast path- profiles in channels. There
are 2 primary reasons for this:

- This is not really a new model type, but just a map of users. And users already use
the fast path. So we can get some more gains without really investing much more code.
- A more important reason is that with the upcoming striped mutex changes, we will get
a higher throughput at the cost of a bit more CPU utilization. The reason being that
since less amount of time will be spent in lock-contention, the CPU is free to do more
stuff. So this change is to counter that increase.

As usual, this gives much better performance than the original decoder.

Micro-benchmark results
```
name               old time/op    new time/op    delta
LRU/UserMap=new-8    16.6µs ± 3%     3.9µs ± 4%  -76.15%  (p=0.000 n=10+10)

name               old alloc/op   new alloc/op   delta
LRU/UserMap=new-8    4.78kB ± 0%    2.74kB ± 0%  -42.65%  (p=0.000 n=10+10)

name               old allocs/op  new allocs/op  delta
LRU/UserMap=new-8      38.0 ± 0%      30.0 ± 0%  -21.05%  (p=0.000 n=10+10)
```

https://mattermost.atlassian.net/browse/MM-29980

Here are some results from a load test. The comparison is done with a 2 node cluster; one running master
and one running with this patch so that it's easier to compare. The total users are 2000.

<See PR>

```release-note
NONE
```

* Fix gofmt

* Trigger CI
2020-11-04 10:08:10 +05:30
Agniva De Sarker
4758408699 MM-29979: make websocket writes zero-alloc (#16115)
This reverts commit 31dac80e66.
2020-11-04 10:05:10 +05:30
Kaiwalya Koparkar
fb9c2faa1a License Agreement and Documentation added (#16048)
Automatic Merge
2020-11-03 14:37:37 -05:00
Nick Misasi
714435fc4c Pass the filename from CWS on to the client (#16203) 2020-11-03 13:11:18 -05:00
Ikko Ashimine
bec4e361a9 Fix typo in comment (#16198)
occuring -> occurring
2020-11-03 13:14:21 +01:00
Weblate (bot)
b3e8b009a5 Translations update from Weblate (#16193)
* Translated using Weblate (Dutch)

Currently translated at 99.7% (2058 of 2063 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 98.0% (2020 of 2061 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2063 of 2063 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
2020-11-02 21:43:32 +01:00
Jesús Espino
24621a22ed Add the content field to FileInfo (#15749)
* Add the content field to FileInfo

* Fixing the upgrade code

* Trying to fix the text-scheme

* Fixing test-schema

* Fixing test-schema

* Moving the migration to the next version
2020-11-02 15:43:48 +01:00
Ibrahim Serdar Acikgoz
9bff309dd0 storetest/team_store: fix flaky test for searching a short term (#16172)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-31 12:13:28 +03:00
Jared Shields
3515b4d6c9 GH-15624: Added plugin hooks for ReationHasBeenAdded and ReactionHasBeenRemoved (#15765) 2020-10-31 07:06:43 +01:00
Ibrahim Serdar Acikgoz
71c371509b storetest/user_store: fix flaky test (#16095) 2020-10-30 20:09:28 +03:00
Eli Yukelzon
fe352ab57f MM-29703 Mark threads as read when channels are marked (#15994)
Co-authored-by: Jesús Espino <jespinog@gmail.com>
2020-10-30 17:00:21 +02:00
Carlos Tadeu Panato Junior
1729239385 upgrade DB to 5.29 (#16081) 2020-10-30 13:37:26 +01:00
Agniva De Sarker
325bff1176 MM-30041: Return correct error message for user save (#16117)
* MM-30041: Return correct error message for user save

We were collapsing all types of user conflict into a single
error message. Fixed it by inspecting the field of the invalidError type
and returning the correct message.

https://mattermost.atlassian.net/browse/MM-30041

```release-note
NONE
```

* Fix test errors

* Fix wrong message in test when comparing error messages

Co-authored-by: Rodrigo Villablanca <villa061004@gmail.com>
2020-10-30 11:14:06 +05:30
Christopher Speller
1aadd36644 MM-28859 Add feature flag managment system using split.io and remove viper. (#15954)
* Add feature flag managment system using split.io and remove viper.

* Fixing tests.

* Attempt to fix postgres tests.

* Fix watch filepath for advanced logging.

* Review fixes.

* Some error wrapping.

* Remove unessisary store interface.

* Desanitize SplitKey

* Simplify.

* Review feedback.

* Rename split mlog adatper to split logger.

* fsInner

* Style.

* Restore oldcfg test.

* Downgrading non-actionable feature flag errors to warnings.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-29 15:54:39 -07:00
Harrison Healey
8bb772638c MM-29067 Add deterministic IDs for default sidebar categories (#16030)
Automatic Merge
2020-10-29 10:24:01 -04:00
Amy Blais
28983fa88d Update Dockerfile (#16118)
Automatic Merge
2020-10-29 08:54:01 -04:00
Maria A Nunez
5b8b792c4c Added Subscription missing field for LastInvoice (#16111) 2020-10-28 16:46:28 -04:00
Christopher Speller
31dac80e66 Revert "MM-29979: make websocket writes zero-alloc (#16098)" (#16110)
Automatic Merge
2020-10-28 16:24:01 -04:00
Agniva De Sarker
f964be699f MM-29979: make websocket writes zero-alloc (#16098)
* MM-29979: make websocket writes zero-alloc

Instead of allocating a new slice every time we write a message,
we create a json encoder for a byte buffer and then reset the buffer
every time we write a new message.

This allocates a buffer of a constant size per-connection, but gets rid
of a new allocation for every single write, reducing pressure on GC.

After taking a distrbution of message sizes from a load test, it was seen that
2k is a good enough buffer size within which 98.5% of messages remain.

Taking a look at the alloc profiles for (*webconn).writepump:
- master branch: 8.01% of total allocations totalling 64GB
- with this PR: 4.92% and 10GB.

https://mattermost.atlassian.net/browse/MM-29979

* Skip writing in case of an encoding error
2020-10-28 21:42:13 +05:30
Mario de Frutos Dieguez
bb095c2a1a mmctl is not being included in the package (#16105)
It's was including it in the bin folder but when we package we need to include it in the dist/bin so right now the `download_mmctl` script accepts a second parameter to define the path where the binary is going to be stored
2020-10-28 13:59:49 +01:00
Agniva De Sarker
27dbe9e182 MM-28984: Add fallback text to push notification (#16089)
We read the fallback text from message attachments and append that as part
of a push notification.

https://mattermost.atlassian.net/browse/MM-28984

```release-note
NONE
```
2020-10-28 10:42:08 +05:30
Claudio Costa
165c4d2dd1 [MM-29295] Fix data race in app.CreatePost() (#15880)
* Fix data race

* Better naming

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-27 20:11:38 +01:00
Alex Johnson
9cb704d537 Documents exported methods within SqlTeamStore methods (#15996)
Co-authored-by: Justine Geffen <justinegeffen@users.noreply.github.com>
2020-10-27 16:19:11 +01:00
Jesús Espino
8d5be2d657 Document extractor service (#15665)
* Document extractor service

* Fixing vendor modules

* Addressing PR Review comments

* Some small simplifications

* Fixing a linter complain

* simplifying a bit the code using package variables

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-27 15:58:38 +01:00
Ibrahim Serdar Acikgoz
04ef5c682e storetest/reaction_store: add sleep before updating (#16060) 2020-10-27 13:02:25 +03:00
Weblate (bot)
5a9f3ff5c8 Translations update from Weblate (#16085)
* Translated using Weblate (Portuguese (Brazil))

Currently translated at 98.1% (2043 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/pt_BR/

* Translated using Weblate (Russian)

Currently translated at 96.8% (2015 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/

* Translated using Weblate (Dutch)

Currently translated at 99.7% (2076 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 99.6% (2073 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Translated using Weblate (Turkish)

Currently translated at 96.8% (2016 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 99.7% (2076 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/zh_Hans/

* Translated using Weblate (Japanese)

Currently translated at 99.6% (2074 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ja/

* Translated using Weblate (Spanish)

Currently translated at 99.7% (2076 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/es/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

Co-authored-by: rodrigocorsi <rodrigocorsi@gmail.com>
Co-authored-by: Alexey Napalkov <flynbit@gmail.com>
Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: aeomin <lin@aeomin.net>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Elias  Nahum <elias@mattermost.com>
2020-10-27 10:43:32 +01:00
Mario de Frutos Dieguez
f5531a5a43 [MM-29523] EmailVerified flag can be user as parameter (#16031)
* EmailVerified flag can be used as a parameter

But only when if the user creator is an admin
2020-10-27 10:41:20 +01:00
Ben Schumacher
76f1bfb941 [MM-29361] Send cloud flag with Marketplace requests (#15913) 2020-10-26 21:57:19 +01:00
Nick Misasi
3697f92045 [MM-28363] User Limit Overage Warning Emails (#16053)
* Adding files, commit of UI in good shape

* Translations added, working with activation and deactivation

* Add check for error

* Fix i18n?

* Push without subscription check so Steve and Matt can look at it

* Fix font-weight in chrome

* Fix font-weight on button

* UX fixes

* Fixes for PR

* Add back subscription stuff

* Fix tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-26 13:24:26 -04:00
Mario de Frutos Dieguez
b68f171162 [MM-29157] Cloud invoices logic (#16056)
* Cloud invoices logic

This commit includes all the code needed to get and print invoices
from CWS
2020-10-26 18:17:55 +01:00
Miguel de la Cruz
8f895908fc [MM-29220] Adds a client function that retrieves the full status report (#15727)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-26 15:45:58 +01:00
Claudio Costa
9484366784 Fix nil dereference panic in SearchArchivedInTeam (#16064)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-26 15:19:14 +01:00
Agniva De Sarker
72432ab3ff MM-27909: Add manage_shared_channels permission (#15601)
* MM-27909: Add manage_shared_channels permission

We add a new permission to manage shared channels.

It's a channel scoped permission and only the system admin
has that by default.

https://mattermost.atlassian.net/browse/MM-27909

* change to system scoped

* Trigger CI

* Trigger CI

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-26 15:54:50 +05:30
Rodrigo Villablanca
96f1739f8f UserStore migration (#15563)
* Migration completed

* Fix tests

* Fix tests

* Fix tests

* Suggestions

* Trigger CI

* Suggestions

* Merge with master

* Trigger CI

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2020-10-26 15:11:27 +05:30
Agniva De Sarker
d51d843fcd MM-22950: Remove supplier test (#16072)
This test is too flaky to be written as a test. Let's just remove it.

https://mattermost.atlassian.net/browse/MM-29950

```release-note
NONE
```
2020-10-26 13:21:24 +05:30
Agniva De Sarker
087758caee MM-28737: Upgrade dependencies (#15877)
https://mattermost.atlassian.net/browse/MM-28737

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-25 22:09:55 +05:30
Agniva De Sarker
d2730014f9 MM-29525: Strip path_prefix from ListDirectory (#15949)
* MM-29525: Strip path_prefix from ListDirectory

An AWS path prefix is meant to be an implementation detail
which the calling application should not be aware of. Hence, we should
strip the path prefix when returning objects in a directory
because they anyways get applied while using the other APIs

https://mattermost.atlassian.net/browse/MM-29525

* simplify

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-25 22:09:38 +05:30
Devin Binnie
79b5350576 [MM-29937] Don't allow email and contact name to be updated from the MM app (#16058)
* [MM-29937] Don't allow email and contact name to be updated from the MM app

* Switched to use omitempty
2020-10-23 15:39:36 -04:00
Daniel Espino García
910de96a33 Thread autoresponse posts with the post they are autoresponding to (#15625)
* Thread autoresponse posts with the post they are autoresponding to

* Remove unneeded if

* Remove ParentID references

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-23 16:21:21 +02:00
Elisabeth Kulzer
8c63eb7232 DOPS-243: Add manifest.txt (#15959)
* DOPS-243: Add manifest.txt

* Update build/release.mk

* Change path

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-23 09:41:33 +02:00
Scott Bishel
f46661d7a9 MM-28882:ignore guest ldap sync (#15936)
* add ignoreGuestsLdapSync to config, update interface

* update interface

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-21 20:12:12 -06:00
Scott Bishel
efc3304fe1 MM-29522:fix typo in constant name (#15933)
* fix type in constant name

* fix lint

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-21 16:59:54 -06:00
George Goldberg
9b23ee659f MM-29812: Fix a panic in auth code if GetChannel returns an error. (#16010)
* MM-29812: Don't panic if GetChannel returns an error in auth code.

* Fix gofmt

* Add further mocking.

* Another mock.

* More mocks.
2020-10-21 16:59:32 +01:00
Claudio Costa
e5e2dbdf1a [MM-29731] Fix panic in saveUserTermsOfService (#16044)
* Fix panic in saveUserTermsOfService

* Remove unneeded initialization
2020-10-21 17:08:33 +02:00
Ed Trist
91bb7d3b11 [MM-24391] Render icon_emoji names surrounded by colons in incoming webhooks (#15753) 2020-10-21 14:13:10 +02:00
Weblate (bot)
20491c2585 Translations update from Weblate (#16018)
* Translated using Weblate (Dutch)

Currently translated at 99.6% (2073 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 99.6% (2073 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

Translated using Weblate (Dutch)

Currently translated at 99.6% (2073 of 2080 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/

* Update translation files

Updated by "Cleanup translation files" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/

* Translated using Weblate (Korean)

Currently translated at 94.2% (1961 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ko/

* Translated using Weblate (Spanish)

Currently translated at 99.7% (2076 of 2081 strings)

Translation: mattermost-languages-shipped/mattermost-server_master
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/es/

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: retheviper <youngbina@hotmail.com>
Co-authored-by: Elias  Nahum <elias@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-20 18:14:32 +02:00
Devin Binnie
73a1c95137 [MM-28218] API hookup for updating company info and address in MM app (#15974) 2020-10-20 11:46:58 +02:00
Ibrahim Serdar Acikgoz
c05ee81c9f [MM-28125] einterface/oauthprovide: return parsing errors (#15426)
* einterface/oauthprovide: return parsing errors

* Update app/oauth.go

* reflect review comments

* fix var name error

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-19 18:07:20 +03:00
Nick Misasi
90738de75f Add webhook event for when user status changes from activated to deactivated and vice versa (#15990)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-10-19 10:29:43 -04:00
Jesús Espino
f7854f9645 Skipping some telemetry tests on production builds (#16007) 2020-10-19 16:15:54 +02:00