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

14256 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
cfcdce9ae7 Migrate post_store to sqlx (#19241)
* Migrate post_store to sqlx

There are several queries which should improve further
if re-written with squirrel. HW tickets will be opened
for those.

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/ctnryw9mga7fu9kc16xsap4phuw

```release-note
NONE
```

* Remove struct

```release-note
NONE
```

* fix tests

```release-note
NONE
```
2022-01-03 10:40:16 +05:30
Tilto_
aa0b717af7 Translated using Weblate (Korean)
Currently translated at 78.2% (1819 of 2326 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ko/
2021-12-27 13:52:42 -06:00
Matthew Williams
8f11a50b2b Translated using Weblate (English (Australia))
Currently translated at 100.0% (2326 of 2326 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/en_AU/
2021-12-27 13:52:42 -06:00
Tóth Csaba // Online ERP Hungary Kft
c90a97e7ad Translated using Weblate (Hungarian)
Currently translated at 100.0% (2326 of 2326 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/hu/
2021-12-27 13:52:42 -06:00
MArtin Johnson
3ca54860f4 Translated using Weblate (Swedish)
Currently translated at 100.0% (2326 of 2326 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/
2021-12-27 13:52:42 -06:00
Kaya Zeren
e9cc1b241b Translated using Weblate (Turkish)
Currently translated at 100.0% (2326 of 2326 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/
2021-12-27 13:52:42 -06:00
Tom De Moor
340320f1bf Translated using Weblate (Dutch)
Currently translated at 100.0% (2326 of 2326 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/
2021-12-27 13:52:42 -06:00
jprusch
37f9c51289 Translated using Weblate (German)
Currently translated at 100.0% (2326 of 2326 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/de/
2021-12-27 13:52:42 -06:00
Ibrahim Serdar Acikgoz
6c42d2816d Merge pull request #19196 from mattermost/MM-39542
[MM-39542] Allow upsert for duplicate key in LinkMetadataStore
2021-12-22 16:31:59 +03:00
Carlos Tadeu Panato Junior
3b89080863 upgrade db to 6.3.0 (#19217) 2021-12-22 12:41:48 +01:00
Ibrahim Serdar Acikgoz
6bf646c921 . 2021-12-22 12:33:56 +03:00
Kirill Krotov
0dbc74f6d5 [GH-18965] - Pass expire time from outside Cleanup method (#19008)
Pass expire time from outside Cleanup method

Fixes #18965
2021-12-22 14:57:30 +05:30
Ibrahim Serdar Acikgoz
7f2e60289b reflect review comments 2021-12-22 12:24:25 +03:00
Michel Engelen
c198ef6e16 adding a feature flag for inline post editing (#19210) 2021-12-21 08:59:52 +01:00
Allan Guwatudde
81409ee7c4 [MM-40407] - Do not show the Renew Now if the license id does not exist in the portal (#19188)
* [MM-40407] - Do not show the Renew Now if the license id does not exist in the portal

* improvements

* impl mock

* fix translations

* feedback impl

* fix typo

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-12-21 09:46:02 +03:00
Ben Schumacher
34c4e543f9 [MM-39999] Increase key length in plugin KV store to 150 (#19002) 2021-12-20 13:13:50 +01:00
Agniva De Sarker
b836edba40 MM-40537: Bump bleve dependency to fix Sentry crash (#19194)
* MM-40537: Bump bleve dependency to fix Sentry crash

We observed a sentry crash, which is now fixed upstream.
So we bump the dependency accordingly.

```release-note
NONE
```

* Fix vendor/modules.txt

```release-note
NONE
```

* New fix

```release-note
NONE
```

* Trigger CI
```release-note
NONE
```
2021-12-20 14:48:24 +05:30
Agniva De Sarker
87bf8fb9e9 Force right index for post deletion (#19191)
During v6 indexing changes, we replaced
idx_posts_root_id with idx_posts_root_id_delete_at.
This causes MySQL to trigger the index_merge path
again with PRIMARY and idx_posts_root_id_delete_at
as shown below:

```
mysql> UPDATE Posts SET DeleteAt = 1637998911685, UpdateAt = 1637998911685, Props = JSON_SET(Props, '$.deleteBy', 'buqskqrwmjnhfuqskqrwmjn4ca') Where Id = 'q38uaydtpink5f4wkmcsn8h47o' OR RootId = 'q38uaydtpink5f4wkmcsn8h47o';
Query OK, 9 rows affected (17.29 sec)
Rows matched: 10  Changed: 9  Warnings: 0
mysql> EXPLAIN UPDATE Posts SET DeleteAt = 1637998911685, UpdateAt = 1637998911685, Props = JSON_SET(Props, '$.deleteBy', 'buqskqrwmjnhfuqskqrwmjn4ca') Where Id = 'q38uaydtpink5f4wkmcsn8h47o' OR RootId = 'q38uaydtpink5f4wkmcsn8h47o'\G
*************************** 1. row ***************************
           id: 1
  select_type: UPDATE
        table: Posts
   partitions: NULL
         type: index_merge
possible_keys: PRIMARY,idx_posts_root_id_delete_at
          key: idx_posts_root_id_delete_at,PRIMARY
      key_len: 107,106
          ref: NULL
         rows: 9
     filtered: 100.00
        Extra: Using sort_union(idx_posts_root_id_delete_at,PRIMARY); Using where; Using temporary
1 row in set, 1 warning (0.00 sec)
```

To fix the temporary sort, we order by Id

```
mysql> UPDATE Posts SET DeleteAt = 1637998911686, UpdateAt = 1637998911686, Props = JSON_SET(Props, '$.deleteBy', 'buqskqrwmjnhfuqskqrwmjn4ca') Where Id = 'q38uaydtpink5f4wkmcsn8h47o' OR RootId = 'q38uaydtpink5f4wkmcsn8h47o' ORDER BY Id;
Query OK, 9 rows affected (0.01 sec)
Rows matched: 9  Changed: 9  Warnings: 0
mysql> EXPLAIN UPDATE Posts SET DeleteAt = 1637998911686, UpdateAt = 1637998911686, Props = JSON_SET(Props, '$.deleteBy', 'buqskqrwmjnhfuqskqrwmjn4ca') Where Id = 'q38uaydtpink5f4wkmcsn8h47o' OR RootId = 'q38uaydtpink5f4wkmcsn8h47o' ORDER BY Id\G
*************************** 1. row ***************************
           id: 1
  select_type: UPDATE
        table: Posts
   partitions: NULL
         type: index_merge
possible_keys: PRIMARY,idx_posts_root_id_delete_at
          key: idx_posts_root_id_delete_at,PRIMARY
      key_len: 107,106
          ref: NULL
         rows: 9
     filtered: 100.00
        Extra: Using sort_union(idx_posts_root_id_delete_at,PRIMARY); Using where; Using filesort
1 row in set, 1 warning (0.00 sec)
```

Postgres uses Bitmap Heap scan which does
a Bitmap OR of the index tuples and _then_
fetches the rows from the heap. This is a
much better and sophisticated way. Sadly, MySQL
will fetch the rows from the indexes first,
and then do an OR, which is why index_merge_intersection
is so bad.

See: https://developers.mattermost.com/blog/mysql-index-merge/
for more info.

```release-note
NONE
```
2021-12-20 13:55:03 +05:30
Olayiwola Odunsi
08dc3a1cdf [GH-19105] - Add helper function to handle columns on reserved names (#19107)
Automatic Merge
2021-12-17 17:40:31 +02:00
Agniva De Sarker
8b155e34c7 Re-initialize plugins only when needed (#19158)
Previously, for every config change, we would re-initialize
plugins irrespective of whether there would be any actual
plugin related changed or not.

Now, we compute the difference between previous and new configs
and check whether there has been any changes to plugin related
configuration, and re-init plugins only if that's true.

This improves performance as plugin re-initialization is quite
costly.

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/bed59298-27da-4b74-8be5-cdeb4c50c3e2
```release-note
NONE
```
2021-12-17 20:15:17 +05:30
Ben Schumacher
b02e9ba5b0 Allow go benchmarks to use api helpers functions (#19179) 2021-12-17 11:48:31 +01:00
Ibrahim Serdar Acikgoz
ca02fabb91 allow upsert for duplicate key 2021-12-17 11:39:25 +03:00
Allan Guwatudde
0b1e9445c8 [MM-40682] - SIGSEGV after upgrade from 6.1.0 to 6.2.0 (#19192)
* [MM-40682] - SIGSEGV after upgrade from 6.1.0 to 6.2.0

* feedback impl
2021-12-17 09:39:10 +03:00
Carlos Tadeu Panato Junior
36008ae412 fix mmctl download script when using as stand alone script (#19143) 2021-12-16 11:31:57 +01:00
Agniva De Sarker
e4ef39d68f Remove unnecessary test TestValidateToken (#19177)
The TestValidateToken was actually testing
the underlying library rather than testing our code.
So, in a way, it was ineffective.

The actual flaky test was that in a rare care,
the random string generated might actually lead
to 000000 being an actual code rather than invalid.

So using random strings is fundamentally incorrect.
Even the tests in the library use hardcoded strings
and not random strings.

To fix this properly would be to use hardcoded strings,
but then we would just be testing the library
and not our code. To keep things simple,
we just keep the test to verify the error message
and remove the others.

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/cidjhgy1ag3yktn5eszae1489yr

```release-note
NONE
```
2021-12-15 23:01:32 +05:30
Allan Guwatudde
5aba3bb9e2 Improve gif processing (#19164)
* Improve gif processing

* feedback impl
2021-12-15 19:07:24 +03:00
Ujjwal Sharma
1fc8a2ea20 [MM-39640] Migrate from gorp to sqlx in store/sqlstore/role_store.go (#19022)
Automatic Merge
2021-12-15 17:40:31 +02:00
Maksim Matveev
3d412b14af Translated using Weblate (Russian)
Currently translated at 96.0% (2233 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ru/
2021-12-13 11:57:11 -06:00
Tom De Moor
d71e9808fd Translated using Weblate (Dutch)
Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/
2021-12-13 11:57:11 -06:00
Kaya Zeren
c692135802 Translated using Weblate (Turkish)
Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/
2021-12-13 11:57:11 -06:00
Scott Bishel
2727bb122e prepackage boards to v0.10.0 (#19111)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-12-13 14:33:48 +01:00
Yair Facio
3b3ab701b1 [MM-39231] Migrate license store from gorp to sqlx in store/sqlstore/license_store.go (#19146)
Automatic Merge
2021-12-12 08:10:31 +02:00
Yair Facio
62d4d8166d [MM-39636] Migrate from gorp to sqlx in store/sqlstore/retention_policy_store.go (#18994)
* Migrate Save from gorp to sqlx

* Migrate checkTeamsExist from gorp to sqlx

* Migrate checkChannelsExist from gorp to sqlx

* Migrate Patch from gorp to sqlx

* Migrate buildGetPoliciesQuery from gorp to sqlx

* Migrate Get from gorp to sqlx

* Change buildGetPolicyQuery return values

* Migrate GetAll from gorp to sqlx

* Migrate GetCount from gorp to sqlx

* Migrate Delete from gorp to sqlx

* Migrate GetChannels from gorp to sqlx

* Migrate GetChannelsCount from gorp to sqlx

* Migrate AddChannels from gorp to sqlx

* Migrate RemoveChannels from gorp to sqlx

* Migrate GetTeams from gorp to sqlx

* Migrate GetTeamsCount from gorp to sqlx

* Migrate AddTeams from gorp to sqlx

* Migrate RemoveTeams from gorp to sqlx

* Migrate DeleteOrphanedRows from gorp to sqlx

* Migrate GetTeamPoliciesForUser from gorp to sqlx

* Migrate GetTeamPoliciesCountForUser from gorp to sqlx

* Migrate GetChannelPoliciesForUser from gorp to sqlx

* Migrate GetChannelPoliciesCountForUser from gorp to sqlx

* Migrate Delete from gorp to sqlx

* Add mapper tag function before saving a record

Summary:
Since there is a db tag in this model for the ID column,
I set a mapper in this transaction to lowercase
all mapping columns before saving the record.

* Use quoted identifiers when selecting Id

* Address PR comments, replace variable declarations for their short hand syntax

* Enhance subquery implementation

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-12-10 14:57:24 +05:30
Yair Facio
fa38202d98 [MM-39636] Migrate from gorp to sqlx in store/sqlstore/product_notices_store.go (#19012)
* Migrate from gorp to sqlx in ProductNoticesStore

* Address PR comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-12-10 14:48:46 +05:30
Agniva De Sarker
0e00afd65f MM-40469: Handle invalid response codes from plugins (#19136)
* MM-40469: Handle invalid response codes from plugins

This was an interesting crash detected via Sentry.

Typically, any HTTP status code outside 100-999 range
will cause a crash in the HTTP server. And `ExecuteCommand`
is the only plugin hook which returns a model.AppError
instead of error.

So an incorrect plugin implementation could return
a status code of 0, and crash the server. We handle that
by rewriting any illegal response code to 500.

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

```release-note
NONE
```

* added warning

```release-note
NONE
```
2021-12-09 14:17:41 +05:30
Ben Schumacher
052d99c362 Remove dead struct ManifestExecutables (#19122) 2021-12-09 09:22:43 +01:00
Jesse Hallam
92e80bd4ed Pre-package Playbooks v1.22.1 (#19130)
* Pre-package Playbooks v1.22.1

* Bump
2021-12-07 14:56:52 -04:00
Christopher Speller
5ec78546e2 MM-38150 Adding playbooks permissions (#19096)
* Add playbooks related permissions.

* Add RolesGrantPermission to pluginapi

* Fixing scopes.

* New defaults.

* Fix defaults

* Fix tests.

* Fix migration.

* More test and migration fixes.

* Need to add everything to system admin too.

* Move to 63

* Feedback fixes.

* Fix system manager editing playbook permissions.
2021-12-07 09:43:33 -08:00
Agniva De Sarker
129f0aabd3 Remove the remaining fields from *app.Server (#19113)
We move these fields to Channels:
```
uploadLockMapMut sync.Mutex
uploadLockMap    map[string]bool
imgDecoder *imaging.Decoder
imgEncoder *imaging.Encoder
dndTaskMut sync.Mutex
dndTask    *model.ScheduledTask
```

I think this PR should conclue the initial phase
of migrating stuff from Server to Channels.

The remaining task would be to focus on continue
to create the remaining services from the
common things like users, teams, push notifications,
clustering for other products to consume.

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/87df1e15-588e-49ff-8bd1-ffa9651b8c82

```release-note
NONE
```
2021-12-07 21:53:24 +05:30
Claudio Costa
6d361db638 [MM-40485] Enable receiving binary websocket messages (#19128)
* Enable receiving binary websocket messages

* Improve error message

* Prefer anonymous declaration

* Simplify

* Improve test

* Use MessagePack to clone WebSocketRequest struct

* Use short form

* Fix test
2021-12-07 15:24:18 +01:00
kaakaa
64fb04a9e9 Translated using Weblate (Japanese)
Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ja/
2021-12-06 14:07:54 -05:00
MArtin Johnson
797007d639 Translated using Weblate (Swedish)
Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/
2021-12-06 14:07:54 -05:00
Tóth Csaba // Online ERP Hungary Kft
3c26721236 Translated using Weblate (Hungarian)
Currently translated at 100.0% (2325 of 2325 strings)

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

Translated using Weblate (Hungarian)

Currently translated at 100.0% (2325 of 2325 strings)

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

Translated using Weblate (Hungarian)

Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/hu/
2021-12-06 14:07:54 -05:00
gruceqq
862b6da8d7 Translated using Weblate (Polish)
Currently translated at 100.0% (2325 of 2325 strings)

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

Translated using Weblate (Polish)

Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/pl/
2021-12-06 14:07:54 -05:00
Matthew Williams
7ea273cf05 Translated using Weblate (English (Australia))
Currently translated at 100.0% (2325 of 2325 strings)

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

Translated using Weblate (English (Australia))

Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/en_AU/
2021-12-06 14:07:54 -05:00
master7
15bf9c1da0 Translated using Weblate (Polish)
Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/pl/
2021-12-06 14:07:54 -05:00
JtheBAB
199c212759 Translated using Weblate (German)
Currently translated at 100.0% (2325 of 2325 strings)

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

Translated using Weblate (German)

Currently translated at 100.0% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/de/
2021-12-06 14:07:54 -05:00
Tom De Moor
5a8173602d Translated using Weblate (Dutch)
Currently translated at 100.0% (2325 of 2325 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% (2325 of 2325 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/
2021-12-06 14:07:54 -05:00
Kyriakos Z
36c8d1d1a0 MM-36862: removes participant from thread (#18795)
* MM-36862: removes participant from thread

Removing a participant upon last reply deleted from thread didn't work
reliably, a suspect on this is the replica lag, since we are first
deleting the post and then counting non-deleted posts of the participant
to decide on whether to delete or not.

The findings that led to this conclusion is that the reply count gets
updated but the participant is not removed (participant removal depends
on the number of replies this participant has in the thread.)

This commit fixes that by removing first the participant and then
deleting the post.
So we delete the participant if they have 1 post in that thread, and
then we delete the post, so now they have no posts in the thread.

* Makes deleting posts transactional

This commit makes deleting a post transactional and also tries to fix
permanent deletion of posts.

Currently when we permanently delete all posts by a user we don't update
the threads reply count nor the participant's array. This commit tries
to fix that.

* Adds comments on deleting posts

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-12-06 12:01:04 +02:00
Carrie Warner (Mattermost)
d53cffc518 Merge pull request #18917 from mattermost/terminology-update
Updated Account Settings to Settings
2021-12-03 10:20:06 -05:00