Commit Graph

13464 Commits

Author SHA1 Message Date
Martin Kraft
5e076ea36f MM-33402: Invalidated the LRU cache for channel members after moderat… (#17171)
* MM-33402: Invalidated the LRU cache for channel members after moderation changes.

* MM-33402: Handles cache invalidation error.

* Revert "MM-33402: Handles cache invalidation error."

This reverts commit 2d30d24658.

* MM-33402: Un-exports method.

* MM-33402: Removes log warning from previous code use.

* MM-33402: Handles possible (store.ChannelStore).GetMembers error.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-26 14:09:32 -04:00
Jesse Hallam
e3ac469ec6 pre-package Incident Collaboration v1.7.0 (#17234) 2021-03-26 10:53:50 -03:00
Agniva De Sarker
f865703ce9 Remove server from WebsocketRouter (#17238)
App contains server.
Server contains WebsocketRouter.

There is no need for WebsocketRouter to contain
server too. As is evident because the code never used it.

```release-note
NONE
```
2021-03-26 15:19:04 +05:30
Claudio Costa
017e14d4b5 [MM-32822] Improve JobServer state handling (#16959)
Automatic Merge
2021-03-26 10:32:16 +01:00
Ibrahim Serdar Acikgoz
85bc354680 [MM-33640] storetest/team_store: use NewTestId for fields like names etc. (#17204)
* storetest/team_store: use NewTestId for fields like names etc.

* reflect review comments

* fix tests

* we love good old C

* remove rand
2021-03-26 10:02:52 +03:00
Claudio Costa
cd0f92e2e7 [MM-34164] Fix flaky TestS3FileBackend (#17229)
* Fix flaky test

* Disable dumping data on error
2021-03-25 16:58:29 +01:00
Elisabeth Kulzer
5329eac020 Upgrade db and version (#17230) 2021-03-25 15:42:27 +01:00
Agniva De Sarker
94abb34821 MM-34271: Skip test TestLoggingAfterInitialized (#17226)
https://mattermost.atlassian.net/browse/MM-34271

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-25 19:29:06 +05:30
Agniva De Sarker
e567ed09e5 MM-34086: Skippping TestStartServerTLSOverwriteCipher (#17225)
https://mattermost.atlassian.net/browse/MM-34086

```release-note
NONE
```
2021-03-25 17:24:18 +05:30
Claudio Costa
28df047d92 Prevent User.Timezone field to overflow DB column capacity (#17220) 2021-03-25 11:38:43 +01:00
Jason Blais
58069ff7dc Update to correct mailing address in outgoing server and portal email (#17223)
* Update cloud_welcome_email.html

* Update en.json
2021-03-25 10:43:11 +01:00
Agniva De Sarker
b950125d4e MM-33945: Update dependencies (#17201)
* MM-33945: Update dependencies

Ran `make update-dependencies`

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

```release-notes
NONE
```

* fix test
2021-03-25 14:45:13 +05:30
Ibrahim Serdar Acikgoz
adcddf350e app/slashcommands/command_loadtest: fix decoding error (#17199)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-25 11:20:22 +03:00
Agniva De Sarker
1578e25537 MM-34171: Fix racy test TestSentry (#17215)
* MM-34171: Fix racy test TestSentry

The NewServer call sets the global mlog Info variable.
But before that, if we call UpdateConfig with the functional options,
then the store.Set method will call mlog.Info before
it could be set.

To fix that, we prepare the updated config
and pass that directly to NewServer to avoid
having to call UpdateConfig.

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

```release-note
NONE
```

* disable watcher

* Trying yet again

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-25 08:50:55 +05:30
Agniva De Sarker
f60b7437da MM-33893: Disable TCP_NO_DELAY for websocket connections (#17129)
* MM-33893: Disable TCP_NO_DELAY for websocket connections

In very large installations, websocket messages cause too much
traffic congestion by sending too small packets and thereby cause
a drop in throughput.

To counter this, we disable the TCP_NO_DELAY flag for websocket
connections. This has shown to give noticeable improvements in
load tests.

We wrap this in a feature flag for now to let it soak in Community
first.

```release-note
NONE
```

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

* fix gorilla specific conn
2021-03-24 21:04:18 +05:30
Hossein
1f165799e0 [MM-34166] Fix Flaky Test TestGenerateSupportPacket (#17207)
* fix flaky tests

* Revert "fix flaky tests"

This reverts commit 255ce27bf6.

* Fix flaky test

* Fix equal
2021-03-24 07:02:17 -04:00
Agniva De Sarker
aba6471512 revertws (#17216)
* Revert "MM-34000: Use non-epoll mode for TLS connections (#17172)"

This reverts commit 2743089b54.

* Revert "MM-33233: Fix double close of webconn pump (#17026)"

This reverts commit 0f98620b65.

* Revert "MM-33836: Detect and upgrade incorrect HTTP version for websocket handshakes (#17142)"

This reverts commit 4c5ea07aff.

* revert i18n

* Revert "MM-21012: Revamp websocket implementation (#16620)"

This reverts commit a246104d04.

* fix go.mod

* Trigger CI
2021-03-24 15:29:23 +05:30
Claudio Costa
6a65b6ceca [MM-33794] Improve password generation during bulk import (#17147)
Automatic Merge
2021-03-24 10:32:16 +01:00
Harrison Healey
2789be220b Stop trying to build mattermost-redux in CI (#17206) 2021-03-23 13:28:43 -04:00
Mario de Frutos Dieguez
3d845feb7e Split CWS url in two: public and API (#17100)
Signed-off-by: Mario de Frutos <mario@defrutos.org>

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-23 15:27:40 +01:00
Weblate (bot)
545670a047 Translations update from Weblate (#17191)
* Translated using Weblate (Dutch)

Currently translated at 100.0% (2186 of 2186 strings)

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

Translated using Weblate (Dutch)

Currently translated at 100.0% (2186 of 2186 strings)

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

Translated using Weblate (Dutch)

Currently translated at 100.0% (2186 of 2186 strings)

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

* Translated using Weblate (Turkish)

Currently translated at 100.0% (2186 of 2186 strings)

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

* Translated using Weblate (Japanese)

Currently translated at 98.5% (2155 of 2186 strings)

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

* Translated using Weblate (French)

Currently translated at 83.8% (1833 of 2186 strings)

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

* Translated using Weblate (French)

Currently translated at 83.9% (1836 of 2186 strings)

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

* Translated using Weblate (Spanish)

Currently translated at 93.5% (2044 of 2186 strings)

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

* Translated using Weblate (Russian)

Currently translated at 95.1% (2080 of 2186 strings)

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

* Translated using Weblate (Swedish)

Currently translated at 100.0% (2186 of 2186 strings)

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

* Translated using Weblate (French)

Currently translated at 84.0% (1837 of 2186 strings)

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

* Translated using Weblate (Russian)

Currently translated at 95.1% (2080 of 2186 strings)

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

Co-authored-by: Tom De Moor <tom@controlaltdieliet.be>
Co-authored-by: Kaya Zeren <kayazeren@gmail.com>
Co-authored-by: kaakaa <stooner.hoe@gmail.com>
Co-authored-by: Pierre JENICOT <pierre.jenicot@ac-lille.fr>
Co-authored-by: Cyril LD <c.laguilhon.debat@petitclou.de>
Co-authored-by: jesus.espino <jesus@mattermost.com>
Co-authored-by: Edward Smirnov <ed@microolap.com>
Co-authored-by: MArtin Johnson <martinjohnson@bahnhof.se>
Co-authored-by: Elisabeth Kulzer <elisabeth.kulzer@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-23 13:38:38 +01:00
Eli Yukelzon
0cc72342de MM-33544 is_following prop in getPosts API methods (#17093)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-23 13:31:54 +02:00
Mario de Frutos Dieguez
c0971970e9 Revert "Fix initialism errors (PR-3) (#17062)" (#17202)
This reverts commit ea61458f16. This was causing panic in the plugins because the client and the plugin API changed with this PR
2021-03-23 10:32:54 +01:00
Allan Guwatudde
26b86cb3ef [MM-34129] - Cloud 'Congratulations!' email format broken (#17198)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-22 19:19:38 -04:00
Haardik Dharma
ea61458f16 Fix initialism errors (PR-3) (#17062)
* Fix initialism errors

* Revert some changes and regenerate file

* Update client4.go

* Update group_test.go

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-22 22:38:19 +03:00
Max Erenberg
0aa6499a48 MM-29607 allow user to deactivate MFA even when disabled (#16994)
Automatic Merge
2021-03-22 19:32:19 +01:00
Max Erenberg
6a77e24adc MM-28090 User settings api when ldap sync (#16822)
Automatic Merge
2021-03-22 19:02:16 +01:00
Agniva De Sarker
4aac52bced Makefile: Refactor test-server-race (#17196)
test-server-race wasn't using the same set of steps
that the test-server step did. Therefore one test was failing.

Refactored it such that scripts/test.sh can be used to run
normal and race tests as well

```release-note
NONE
```
2021-03-22 23:11:50 +05:30
Mattermost Build
9d65b72a3a Bump version (#17195)
Co-authored-by: Mmbot <mmbot@mattermost>
2021-03-22 16:23:11 +01:00
Agniva De Sarker
7c041a0f71 MM-34124: Enable race tests on master branch (#17192)
Automatic Merge
2021-03-22 10:32:16 +01:00
Ibrahim Serdar Acikgoz
35cfab33fc store/post: fix searching for phrases in postgres (#17042)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-22 11:03:26 +03:00
Agniva De Sarker
33e319366c MM-34080: Removing sqlite entirely (#17188)
* MM-34080: Removing sqlite entirely

The initial commit missed removing this blank import.
So the library still remained in our vendor directory.
Removing it for good now.

Bye bye sqlite.

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

* fix go.mod
2021-03-19 20:23:23 +05:30
Agniva De Sarker
2743089b54 MM-34000: Use non-epoll mode for TLS connections (#17172)
* MM-34000: Use non-epoll mode for TLS connections

A *crypto/tls.Conn does not expose the underlying TCP connection
or even a File method to get the underlying file descriptor
like the way a *net/TCPConn does. Therefore the netpoll code would
fail to get the file descriptor.

Relevant issue here: https://github.com/mailru/easygo/issues/3

It is indeed possible to use reflect black magic to get the unexported
member, but I have found unexpected errors during writing to the websocket
by getting the file descriptor this way. I do not want to spend time investigating
this especially since this is already released.

Once this is out, we can decide on the right way to fix this, most probably
by proposing to expose the File method or some other way.

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

```release-note
Fix an issue where websockets wouldn't work with TLS connections.
In that case, we just fall back to the way it works for Windows machines,
which is to use a separate goroutine for reader connection.
```

* Ignore logging errors on non-epoll

On non-epoll systems, we needed to return an error
to break from the loop. But in that case, there is no
need to log the error
2021-03-18 22:27:53 +05:30
Agniva De Sarker
476846c28e Disable unparam (#17167)
Automatic Merge
2021-03-17 18:18:32 +01:00
Claudio Costa
d3a003dcb2 Address outstanding merging issues with cloud branch (#17160) 2021-03-17 10:39:46 +01:00
Jesús Espino
c5e1b36dd3 Making the posts tests a bit more robust (#17151) 2021-03-16 15:55:55 +01:00
Max Erenberg
4699845c0a Mm 29605 read permission s3 bucket (#16977)
Automatic Merge
2021-03-16 15:48:32 +01:00
Claudio Costa
f0ccaa89bf [MM-33603] Fix nil dereference panic in (*App).CreatePost() (#17124)
* Fix possible nil dereference

* fixed nil dereference for unfollowed thread

Co-authored-by: Eli Yukelzon <reflog@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 14:30:52 +01:00
Allan Guwatudde
cee7f8ba4e [MM-33498] - Correct Admin Console Reference (#17076)
* [MM-33498] - Correct Admin Console Reference

* Fix translations

* Fix translations

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 16:20:00 +03:00
Jesús Espino
7208952010 Improve file search results with postgres (#17112)
* Improve file search results with postgres

* Adding channel id to search results

* Fixing file info saves
2021-03-16 11:19:13 +01:00
Jesús Espino
2417fb265d Moving markdown to corelibs (#16916)
* Moving markdown to corelibs

* Fix golangci-lint problem

* Renaming corelibs to pkg

* Fixing golangci-lint

* Renaming from pkg to shared

* Fixing gofmt

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 11:18:41 +01:00
Agniva De Sarker
23dd4a5946 MM-31396: Fix a possible deadlock with SidebarCategories (#17109)
This is a deadlock due to reversed locking order of the SidebarChannels
and SidebarCategories table.

I could not find the exact culprit query from the deadlock output
because it only shows the last query a transaction is running. And from looking
at the code, the only query that runs "UPDATE SidebarCategories SET DisplayName = ?, Sorting = ? WHERE Id = ?"
is UpdateSidebarCategories. But for the deadlock to happen, it has to lock
SidebarChannels _first_, and then _then_ lock SidebarCategories.

Looking a bit more throughly, I found that DeleteSidebarCategory does indeed
lock the tables in an inverse way and if DeleteSidebarCategory runs concurrently with
UpdateSidebarCategories, they will deadlock.

Here's how it will happen.

```
tx1
DELETE FROM SidebarChannels WHERE CategoryId = 'xx';

tx2
UPDATE SidebarCategories SET DisplayName='dn' WHERE Id='xx';

tx2
DELETE FROM SidebarChannels WHERE (ChannelId IN ('yy') AND CategoryId = 'xx');

tx1
DELETE FROM SidebarCategories WHERE Id = 'xx';
```

And then we see:
ERROR 1213 (40001): Deadlock found when trying to get lock; try restarting transaction

To fix this, we simply reorder the Delete query to lock the SidebarCategories first,
and then SidebarChannels.

In fact, any transaction updating/deleting rows from those two tables should always operate on that order
if possible.

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

```release-note
Fixed a database deadlock that can happen if a sidebar category is updated and deleted at the same time.
```
2021-03-16 15:07:30 +05:30
Alejandro García Montoro
c40f898bd0 Bump Incident Collaboration plugin to v1.6.0 (#17143)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 09:55:06 +01:00
Mahmudul Haque
62fa7b9350 unparam lint (#16927)
* fix "always receives ..." lint err

* add unparam lint check

* fix failed test

* rm details param

* ignore unparam lint

* magic string replaced with model.NewRandomString

* rm unused enableComplianceFeatures param

* generate random message inside createPost

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-16 12:48:20 +05:30
Agniva De Sarker
4c5ea07aff MM-33836: Detect and upgrade incorrect HTTP version for websocket handshakes (#17142)
Our proxy configuration was historically incorrect, due to which
a lot of customers have that in their setups. As a result, strictly
following the websocket RFC results in a breaking change.

For now, we transparently upgrade the version header to 1.1, if we detect 1.0.
If a client was sending 1.0, it wouldn't have worked anyways because persistent
connections were introduced from 1.1 onwards.

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

```release-note
WebSocket handshakes done with HTTP version lower than 1.1 will result in a warning,
and the server will transparently upgrade the version to 1.1 to comply with the
websocket RFC.

This is done to work around incorrect nginx (and other proxy) configs that do not set
the proxy_http_version directive to 1.1.

This facility will be removed in a future Mattermost version and it is strongly recommended
to fix the proxy configuration to correctly use the websocket protocol.
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-15 23:02:24 +05:30
Ibrahim Serdar Acikgoz
157f9b5cae update translation string id to be more descriptive (#17002)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-15 18:22:25 +01:00
Ibrahim Serdar Acikgoz
78532699d0 api4/user: add promte/demote uset to local router (#17036) 2021-03-15 18:20:58 +01:00
Agniva De Sarker
936540ea58 MM-33789: Revert fallback to master for GetAllProfilesInChannel (#17119)
* MM-33789: Revert fallback to master for GetAllProfilesInChannel

This fixes a regression introduced in https://github.com/mattermost/mattermost-server/pull/16911.

It was causing problems with too many invalidations and overloading the writer instance for big installations.
Reverting this does not affect correctness at all because it was done out of abundance of caution and the
idea at that point was it was to be done for all caches.

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

```release-note
NONE
```

* fix gofmt issues
2021-03-15 19:51:49 +05:30
Anurag Shivarathri
145fa97069 MM-31054 demote user (#16990)
* changing SchemeAdmin to false on demotion

* Added test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-03-15 18:33:54 +05:30
Jesús Espino
8abb4184b5 Extracting mail service into shared libs (#17030)
* Extracting mail service into shared libs

* Fixing golangci-lint
2021-03-15 11:50:13 +01:00