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

14829 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
84dbf894ea Added index on SidebarCategories table (#20045)
```release-note
NONE
```


Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-27 01:14:18 +05:30
Christopher Speller
e284b811df Add subresource integrety (#20257) 2022-05-26 10:54:11 -07:00
Kyriakos Z
3391adb67b MM-44568: sanitizes profiles in posts (#20291)
* MM-44568: sanitizes profiles in posts

* Fixes tests

* Adds test

* Satisfy vet
2022-05-26 15:41:06 +03:00
Ibrahim Serdar Acikgoz
9985e22dab app: add permissions wrapper (#20242) 2022-05-26 14:03:47 +03:00
Agniva De Sarker
0dd1969bd5 MM-31396: Attempt to fix deadlock while updating sidebar categories (#20215)
A deadlock that has been found on our Community servers is:

```
------------------------
LATEST DETECTED DEADLOCK
------------------------
2022-03-03 06:14:37 0x2aec58887700
*** (1) TRANSACTION:
TRANSACTION 1043681684, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 23 lock struct(s), heap size 1136, 137 row lock(s), undo log entries 26
MySQL thread id 448011, OS thread handle 47195956565760, query id 752406931 10.128.147.211 mmcloud updating
DELETE FROM SidebarChannels WHERE ((ChannelId IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) OR ChannelId IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)) AND CategoryId = ?)
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 907 page no 368 n bits 0 index PRIMARY of table `mattermost`.`SidebarChannels` trx id 1043681684 lock_mode X waiting
Record lock, heap no 121 PHYSICAL RECORD: n_fields 6; compact format; info bits 0
 0: len=26; bufptr=0x2aebbd36b75c; hex= 3363776f6a6a6d36316a62663967657036706872316533696a77; asc 3cwojjm61jbf9gep6phr1e3ijw;;
 1: len=26; bufptr=0x2aebbd36b776; hex= 3568616279726d36746a6265747061656538786973786d6b7177; asc 5habyrm6tjbetpaee8xisxmkqw;;
 2: len=26; bufptr=0x2aebbd36b790; hex= 373568726a7a68676169726370653477696877727866716f7463; asc 75hrjzhgaircpe4wihwrxfqotc;;
 3: len=6; bufptr=0x2aebbd36b7aa; hex= 00003e355176; asc   >5Qv;;
 4: len=7; bufptr=0x2aebbd36b7b0; hex= 39000352420fce; asc 9  RB  ;;
 5: len=8; bufptr=0x2aebbd36b7b7; hex= 80000000000000fa; asc         ;;

*** (2) TRANSACTION:
TRANSACTION 1043681679, ACTIVE 0 sec starting index read
mysql tables in use 1, locked 1
LOCK WAIT 76 lock struct(s), heap size 1136, 294 row lock(s), undo log entries 72
MySQL thread id 447990, OS thread handle 47194812454656, query id 752406930 10.128.147.211 mmcloud updating
DELETE FROM SidebarChannels WHERE ((ChannelId IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) OR ChannelId IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)) AND CategoryId = ?)
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 907 page no 368 n bits 0 index PRIMARY of table `mattermost`.`SidebarChannels` trx id 1043681679 lock_mode X
Record lock, heap no 121 PHYSICAL RECORD: n_fields 6; compact format; info bits 0
 0: len=26; bufptr=0x2aebbd36b75c; hex= 3363776f6a6a6d36316a62663967657036706872316533696a77; asc 3cwojjm61jbf9gep6phr1e3ijw;;
 1: len=26; bufptr=0x2aebbd36b776; hex= 3568616279726d36746a6265747061656538786973786d6b7177; asc 5habyrm6tjbetpaee8xisxmkqw;;
 2: len=26; bufptr=0x2aebbd36b790; hex= 373568726a7a68676169726370653477696877727866716f7463; asc 75hrjzhgaircpe4wihwrxfqotc;;
 3: len=6; bufptr=0x2aebbd36b7aa; hex= 00003e355176; asc   >5Qv;;
 4: len=7; bufptr=0x2aebbd36b7b0; hex= 39000352420fce; asc 9  RB  ;;
 5: len=8; bufptr=0x2aebbd36b7b7; hex= 80000000000000fa; asc         ;;

[bitmap of 256 bytes in hex: 00 00 00 00 00 00 00 f0 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 907 page no 67 n bits 0 index PRIMARY of table `mattermost`.`SidebarChannels` trx id 1043681679 lock_mode X waiting
Record lock, heap no 103 PHYSICAL RECORD: n_fields 6; compact format; info bits 0
 0: len=26; bufptr=0x2aeb4515ec1b; hex= 6431376b35706f71786979776d6b6d616b6a78623539356b366f; asc d17k5poqxiywmkmakjxb595k6o;;
 1: len=26; bufptr=0x2aeb4515ec35; hex= 7067653939686a356562676b38636f6f70637a6e7871677a6568; asc pge99hj5ebgk8coopcznxqgzeh;;
 2: len=26; bufptr=0x2aeb4515ec4f; hex= 336e3731636a73656f667931397267746664337962786d713777; asc 3n71cjseofy19rgtfd3ybxmq7w;;
 3: len=6; bufptr=0x2aeb4515ec69; hex= 00003e34fa4d; asc   >4 M;;
 4: len=7; bufptr=0x2aeb4515ec6f; hex= 4600026d940e4c; asc F  m  L;;
 5: len=8; bufptr=0x2aeb4515ec76; hex= 8000000000000082; asc         ;;

*** WE ROLL BACK TRANSACTION (1)
```

It seems like 2 DELETE queries are somehow deadlocking on the same row.

On looking at it deeply, we can see that in an updateSidebarCategory scenario,
we run 2 delete queries in a single transaction. In that delete query, we not only delete the existing channels for a category,
but also delete the new channels that are going to be inserted in the new category.

The potential issue with this is that since we are updating both the source and destination category in a single transaction,
the category which is moved appears in the destination section for the first category, and in the source section for the second category.
Which means in a single transaction, you have 2 queries possibly interlocking due to the same channels.

Therefore, if we run 2 separate updateCategories with an inverted order of categories, then the same set of delete queries
can lock on the opposite order of channels and cause a deadlock.

I haven't been able to reproduce this, but just a hunch. And in any case, this will reduce the number of DB updates.

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-26 14:44:55 +05:30
Ashish Bhate
2315fcf05b MM-43780: Adjust getPostThread API for easier pagination (#20172)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-25 18:18:05 -04:00
Alejandro García Montoro
b10ff1b1f7 MM-44221: Add admin console setting to enable/disable App Bar (#20224)
* Revert "[MM-39820] Add AppBarEnabled feature flag (#18967)"

This reverts commit ba1b279c5f.

* Add EnableAppBar admin setting

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-25 22:53:51 +02:00
Michael Kochell
ea5bfe3fd9 Cloud Freemium - Integrations (#20185)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-25 12:36:08 -04:00
Christopher Poile
54a88fb532 prepackage calls 0.5.3 (#20286) 2022-05-24 16:50:53 -04:00
Ashish Bhate
ac34a94155 fix conflict in migration numbers (#20275) 2022-05-24 19:29:52 +02:00
Nick Misasi
50d069e86d [MM-44307] On Limits Change, archive or restore teams according to the limits (#20247)
Automatic Merge
2022-05-24 16:16:24 +03:00
master7
380a0ef827 Translated using Weblate (Polish)
Currently translated at 100.0% (2330 of 2330 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/pl/
2022-05-23 18:43:19 +02:00
kaakaa
ebe1efc757 Translated using Weblate (Japanese)
Currently translated at 100.0% (2330 of 2330 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/ja/
2022-05-23 18:43:19 +02:00
Matthew Williams
32e91e6a44 Translated using Weblate (English (Australia))
Currently translated at 99.3% (2314 of 2330 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/en_AU/
2022-05-23 18:43:19 +02:00
Tóth Csaba // Online ERP Hungary Kft
eae40785a4 Translated using Weblate (Hungarian)
Currently translated at 99.5% (2320 of 2330 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/hu/
2022-05-23 18:43:19 +02:00
MArtin Johnson
959816f748 Translated using Weblate (Swedish)
Currently translated at 100.0% (2330 of 2330 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/
2022-05-23 18:43:19 +02:00
Kaya Zeren
ef4087e44c Translated using Weblate (Turkish)
Currently translated at 100.0% (2330 of 2330 strings)

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

Translated using Weblate (Turkish)

Currently translated at 100.0% (2330 of 2330 strings)

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

Translated using Weblate (Turkish)

Currently translated at 99.9% (2328 of 2330 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/tr/
2022-05-23 18:43:19 +02:00
jprusch
1e6622e780 Translated using Weblate (German)
Currently translated at 100.0% (2330 of 2330 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/de/
2022-05-23 18:43:19 +02:00
Harshil Sharma
b13d5e7466 Added Archived column to FileInfo (#20164)
* Added Archived column to FileInfo

* fixed typo

* Added new column to store column list

* Fixing tests

* Updated migration number to syncup with master
2022-05-23 12:15:56 +05:30
Miguel de la Cruz
c100fc2135 Revert "config/diff: add utility function to get diffs scoped with struct tags (#20206)" (#20256)
Automatic Merge
2022-05-21 00:16:24 +03:00
Kyriakos Z
9a67ae9ac6 MM-38982: fixes SVG uploading (#20141)
* MM-38982: fixes SVG uploading

Uploading SVG files was "almost" treated like an image in some places,
resulting in not showing the SVG on the client.
This is happening because when we fail to generate a mini preview for an
image, we prepend "invalid-" to the MimeType.

This commit adds a check to guard against SVG files in methods that make
no sense for SVGs.

* Reverts invalid-{mimetype} fix

* Uses fileInfo.IsSvg() where it can
2022-05-20 10:26:21 -04:00
Vishal
2a9f78536f [MM-43798] Change default CRT option from Disabled to AlwaysOn (#20114)
* MM-32692 Add two more CRT options

* [MM-43798] Change CRT default to AlwaysOn

* Rename variable

* fix test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Ashish Bhate <ashish.bhate@mattermost.com>
2022-05-18 18:53:41 +02:00
Mattermod
91ffe24c14 Update latest version to 6.7.0 (#20219)
Automatic Merge
2022-05-18 17:39:55 +03:00
Agniva De Sarker
1f9657106b MM-31353: Fix flaky TestNoticeValidation/notice_with_specific_date_check (#20238)
We now generate the current time in UTC to avoid date transitions
when running the tests at different local times.

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

```release-note
NONE
```
2022-05-18 18:53:41 +05:30
Pablo Andrés Vélez Vidal
f08d65909f MM-43529 - start freemium trial (#20163)
* MM-43529 - start freemium trial

* change the method to put

* Add unit testing for the request-trial-endpoint

* use correct require

* add the translation texts

* fix texts

* remove unnecessary log

* change response status code to forbidden when non cloud

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
2022-05-18 10:19:38 +02:00
Agniva De Sarker
617007a56d MM-42379: Do not set TrustedProxyIPHeader for new instances (#20217)
We move away with the update logic and just set an empty
slice always.

```release-note
The value of ServiceSettings.TrustedProxyIPHeader will default
to empty from now on. A previous bug prevented this from happening
in certain conditions. Customers are requested to check for these
values in their config and set them to nil if necessary.
```
2022-05-18 13:02:55 +05:30
Hosted Weblate
6360059059 Update translation files
Updated by "Remove blank strings" hook in Weblate.

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

Update translation files

Updated by "Remove blank strings" hook in Weblate.

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/
2022-05-17 14:27:46 +02:00
gavin-luo
89bdba479d Translated using Weblate (Chinese (Simplified))
Currently translated at 99.0% (2308 of 2329 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/zh_Hans/
2022-05-17 14:27:46 +02:00
aeomin
7beb636a42 Translated using Weblate (Chinese (Simplified))
Currently translated at 99.0% (2308 of 2329 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/zh_Hans/
2022-05-17 14:27:46 +02:00
Tom De Moor
4b132e3eef Translated using Weblate (Dutch)
Currently translated at 100.0% (2329 of 2329 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 99.9% (2327 of 2328 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/nl/
2022-05-17 14:27:46 +02:00
jprusch
f4d1e5dc18 Translated using Weblate (German)
Currently translated at 100.0% (2329 of 2329 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% (2328 of 2328 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/de/
2022-05-17 14:27:46 +02:00
Tóth Csaba // Online ERP Hungary Kft
6588facd0a Translated using Weblate (Hungarian)
Currently translated at 99.5% (2319 of 2329 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 99.5% (2318 of 2328 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/hu/
2022-05-17 14:27:46 +02:00
master7
957c8e2370 Translated using Weblate (Polish)
Currently translated at 100.0% (2328 of 2328 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% (2327 of 2327 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/pl/
2022-05-17 14:27:46 +02:00
Matthew Williams
3749573ebd Translated using Weblate (English (Australia))
Currently translated at 99.3% (2311 of 2327 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/en_AU/
2022-05-17 14:27:46 +02:00
MArtin Johnson
276be5558f Translated using Weblate (Swedish)
Currently translated at 100.0% (2329 of 2329 strings)

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

Translated using Weblate (Swedish)

Currently translated at 100.0% (2327 of 2327 strings)

Translation: mattermost-languages-shipped/mattermost-server
Translate-URL: https://translate.mattermost.com/projects/mattermost/mattermost-server_master/sv/
2022-05-17 14:27:46 +02:00
Vishal
fd703a365b [MM-43917] Cloud Freemium limits API: messages/posts (#20152)
* WIP - Add api and app funcs

* Add test cases

* Add utils testcases

* Exclude deleted posts

* Add doc for func

* Move api from cloud to usage

* Allow api access to authenticated users

* Change int to int64

* Fix lint issue

* Simplify err check

Co-authored-by: Ashish Bhate <ashish.bhate@mattermost.com>

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Ashish Bhate <ashish.bhate@mattermost.com>
2022-05-17 13:30:40 +02:00
Jesse Hallam
9c851e996c Introduce (Get|Select|Exec)Builder (#20029) 2022-05-16 14:48:21 -03:00
Ibrahim Serdar Acikgoz
8802c6c9d6 config/diff: add utility function to get diffs scoped with struct tags (#20206) 2022-05-16 15:12:12 +03:00
Agniva De Sarker
aa59c28b04 POC: Cross-team recent search (#20027)
Just a quick POC to move fast :P

We use a search pointer to keep track of
the next row to inesrt to. For every new search
we increment the pointer and do modulo 5.
This means that the value will always remain
between 0-4. And that way, we will always overwrite
the oldest entry on every search.

And while getting the results, we get
all results for that user.

The search parameters are json marshalled
and stored as a JSON blob. This is because
there is no need to search/filter them
in the DB.

Pending items:
Tests obviously.

To improve:
The client needs to send the channel ids
instead of channel names.
2022-05-16 13:16:11 +05:30
Mattermod
979b616189 Update minor version to 7.0 (#20199)
Automatic Merge
2022-05-13 16:09:55 +03:00
Ashish Bhate
a99d5a34b7 MM-44148: fix race in CRT settings test (#20196)
* MM-44148: Remove test parallization to prevent race

* don't export pointer to loop variable

* capture whole loop variable
2022-05-13 12:38:38 +02:00
Agniva De Sarker
6e574aefd0 MM-41569: Prevent compliance directory to be changed on cloud instances (#20198)
https://mattermost.atlassian.net/browse/MM-41659

```release-note
NONE
```
2022-05-13 14:14:26 +05:30
Miguel de la Cruz
bcd65c513b Fixes a null pointer if the plugin requests the limits on a non-cloud server (#20197) 2022-05-12 17:05:44 +02:00
Agniva De Sarker
acae0031d1 MM-44101: GraphQL: Add sidebar categories at the top level (#20178)
Also, add a negate parameter to the team members to get
all sidebarcategories except the default team.

```release-note
NONE
```
2022-05-12 20:03:47 +05:30
Ashish Bhate
3c625743e5 MM-43716: enforce size limits in slack importer (#20144)
Automatic Merge
2022-05-12 16:09:55 +03:00
Ashish Dhama
87a719b4b4 [MM-44123] Advanced Text Editor Feature Flag (#20184)
* Advance Text Editor Feature Flag

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-12 16:28:09 +05:30
Agniva De Sarker
9dcd1df8f8 MM-44148: Skip racy TestIsCRTEnabledForUser (#20194)
https://mattermost.atlassian.net/browse/MM-44148

```release-note
NONE
```
2022-05-12 14:34:53 +05:30
Agniva De Sarker
2c155cdc95 Makefile: Added setup-go-work to build step as well (#20193)
Without this, the go.work file would not get
generated in a fresh build.

```release-note
NONE
```
2022-05-12 14:08:39 +05:30
Josh Soref
109a39eacf spelling: build (#19649)
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-12 13:18:48 +05:30
Agniva De Sarker
52661807f7 MM-41655: Prevent mmctl import into cloud instances (#20191)
mmctl import is not supported and therefore we stop it.

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

```release-note
NONE
```
2022-05-12 12:37:59 +05:30