* Fix the team and channel filtering UT to include empty team or channel
* Fix tests that were failing before this change
Once we've activated the team/channels filter tests for PostgreSQL
and MySQL there are some tests failing so this changes fixes them
* Disable team filtering tests for DBs by now
We have a discrepancy between DB search and ES/Bleve on how to filter
teams when you have users in both teams:
- DB when filtering by one team and searching by another returns users that are in both teams
- Bleve and ES returns empty
Co-authored-by: Mario de Frutos <mario@defrutos.org>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* 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
* 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
* 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>
* 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
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
* 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>
* 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>
* 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>
* 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>
* 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>