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

1603 Коммитов

Автор SHA1 Сообщение Дата
Ibrahim Serdar Acikgoz
5e69c6b02f Move cluster, webhub and store out of Server (#20899) 2022-10-06 11:04:21 +03:00
Nathaniel Allred
7186689f54 Mm 46065 (#20893)
* if thread is archived, allow the archived time to be returned instead of throwing an error
2022-09-30 13:20:26 -05:00
Michael Kochell
15b5b1c191 Avoid counting top channel posts for posts made by plugins and OAuth apps (#20943)
* add from_integration prop to oauth posts to:
- oauth app posts
- plugin posts
- slash command responses
- incoming webhook posts

* tests

* include check for bot posts

* use from_plugin and from_oauth_app props

* fix test

* avoid counting top channel posts for posts made by plugins and oauth apps
2022-09-30 04:12:15 -04:00
cyrilzhang-mm
aee1600d49 [MM-42400] Prevent making groups with reserved names (#21040) 2022-09-29 09:23:27 -04:00
Vishal
f5f036d94b [MM-44489] Cloud limits: enforcing files (#20703)
* Update last accessible file time

* Filter fileInfos

* Set inaccessible header

* Fix lint issue

* Fix lint issue

* Fix i18n

* add nil check

* Fix merge conflicts

* Add helper functions to clear out inaccessible files content

* Remove content for inaccessible files

* Fix typo

* wip

* Remove InaccessibleContent field, instead use Archived

* Add store tests

* Add tests

* Add separate funcs to ignore cloud limits

* Use separate query for MySql

* Use GetReplicaX

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-28 12:52:53 -04:00
Orlando Romo
b9834a2fc2 [MM-42191]: Include deleted posts (#19985)
* MM-42191: Include deleted posts: Add includeDeleted query parameter for getPostsForChannel

* MM-42191: Fix error typo for includeDeleted query parameter

* MM-42191: Include deleted posts: Set permission error when deleted posts are requested by non system admins

* MM-42191: Include deleted posts: Refactor replyCountSubQuery and conditions when includeDeleted is not presented, refactor getRootPosts

* MM-42191: Include deleted posts: Refactor getRootPosts function along with skipFetchThreads and includeDeleted

* MM-42191: Include deleted posts: Rename includeDeleted to include_deleted param

* MM-42191: Include deleted posts: Fix failed posts unit tests

* MM-42191: Include deleted posts: Add missing include deleted option in multiple queries

* MM-42191: Include deleted posts: Add tests for include deleted option in TestGetPostsForChannel, TestGetPostsBefore, TestGetPostsAfter

* MM-42191: include deleted posts: Add tests cases for post store test

* MM-42191: Include deleted posts: Add extra unit test to ensure not returning deleted posts when IncludeDelete is false

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-27 14:00:42 -04:00
Mattermod
99c9957fcf Merge branch 'master' into MM-45580-notify-admin-delinquency-update-billing 2022-09-13 14:35:21 +03:00
Said Atrahouch
10ae097589 [MM-45580] Send deliquency since to end users and allow new notify admin request 2022-09-12 17:39:17 +02:00
Shivashis Padhi
38aaa9e3d3 [MM-46603] P1 - Improvements in handling '0 posts' channels (#20905)
Automatic Merge
2022-09-09 20:34:00 +03:00
Shivashis Padhi
8b328386c5 MM-46911: P1 - Fix MySQL query to filter bots out of TopDM (#20965)
Automatic Merge
2022-09-09 18:34:00 +03:00
Daniel Espino García
56bf9cec50 Add missing field "sortOrder" to graphQL schema (#20956)
* Add missing field "sortOrder" to graphQL schema

* Add test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-08 09:30:53 +02:00
Agniva De Sarker
1fc5fcd900 MM-46911: Skip flaky TestGetTopDMsForUserSince (#20962)
https://mattermost.atlassian.net/browse/MM-46911

```release-note
NONE
```
2022-09-08 11:43:49 +05:30
Shivashis Padhi
4ffdf6b859 [MM-46667] P1 Fix top DM insights pagination (#20896)
Automatic Merge
2022-09-07 23:34:01 +03:00
Agniva De Sarker
f67c7cbbdf MM-46902: Skip TestFileinfosForPost (#20955)
https://mattermost.atlassian.net/browse/MM-46902

```release-note
NONE
```
2022-09-07 09:31:20 +05:30
Agniva De Sarker
a0ab03a31e MM-46869: Fix channel props not appearing in GraphQL (#20944)
The props map was being null, but the schema did not
allow nulls. Therefore, the whole response was being
set to null. There was no error which created more
confusion.

To avoid making the property nillable, which would
mean sending pointers to maps, we just create
empty maps if they are nil.

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

```release-note
NONE
```
2022-09-07 08:38:41 +05:30
Agniva De Sarker
696b9e0872 Optimize CI test runtime
This PR makes 2 main changes to the tests:
1. User logins were a huge part of the total CPU time because of the constant hashing of the password. There were 3 logins every time for every `Setup()` call. We remove the `LoginSystemManager` from the Setup call as it wasn't used in a lot of tests, and call that as needed.
2. We add the new app migrations that got added after the last preload optimization was done.

This shaves off around 3 mins from the test runtime. They are down from ~18m to ~15m.

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-06 13:55:06 +05:30
Allan Guwatudde
bd42f0cd8c [MM-45564] - Notify Admin v2 (#20777)
* [MM-45564] - Notify Admin v2

* add dummy data

* update dummy data

* add store methods

* experiment with recurring task

* complete saving of the notification

* make improvements

* make improvements

* add store layer tests

* fix lint

* update store layer tests

* add app layer unit tests

* add store layers

* add app layer tests

* fix lint

* fix lint

* fix tests

* fix tests lint

* fix lint

* fix lint

* fix retry layer test

* add notifications manual trigger

* filter notifications based on current plan

* add test case

* temp change

* feedback impl

* fix translations

* change job scheduler

* refactor job

* fix store layer tests

* extract i18n

* fix lint

* fix translations

* fix translations

* add license statement for new file

* feedback impl-2

* fix lint

* update make file

* add intl ids

* improve

* fix lint

* feedback impl

* move code and rename files

* fix lint

* feedback impl

* add config for trigger notifications api

* fix tests

* tmp change

* undo temp changes

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-02 13:52:48 +03:00
Kyriakos Z
c11ad8995f Adds OmitConnection parameter to broadcast (#20723)
* Adds OmitConnection parameter to broadcast

Currently we have no means to omit sending a websocket event to a
specific connection id.
This is needed mainly so that the initiator won't receive an event for
the action it just initiated.
Will be used for the global drafts feature, so that we won't update
drafts through ws when a user is typing.

This commit adds OmitConnection to the Broadcast struct and to the
NewWebSocketEvent function signature.
shouldSendEvent should return false for that specific connection.

* Return early only if connection id matches the omitted

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-09-02 13:17:22 +03:00
Agniva De Sarker
c72e9131f4 MM-46577: Remove empty translation strings (#20876)
We replace the empty translation key with <untranslated>
which is ignored by the translation check tool.

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

```release-note
NONE
```
2022-08-25 19:59:16 +05:30
Nick Misasi
e8a45a8cf7 [MM-43399] Cloud Delinquency Email Sequence (#20814)
* Add DelinquentSince to Subscription fields

* Stashing, migrating

* Adding file

* Adding many email templates

* Fix templates pipeline

* Fix translations

* Fix mocks

* Many changes

* Adjust mocks

* Update i18n/en.json

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* PR fixes

* Update string

* Update i18n/en.json

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Update URL's for buttons to open the delinquency modal

* Update emails from mjml

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
2022-08-25 09:39:35 -04:00
Shivashis Padhi
6adbcc5d05 MM-45899: Insights: least active channels (#20796)
* Add api endpoints, app layers for top inactive channels with dummy store calls

* Add store functions for top inactive channels

* Add model, store, app tests.

* Add client function and api tests

* Add participants information to TopInactiveChannel

* Translation fix

* Style fix while writing response

* Return channelmember IDs instead of profiles, query in batch avoiding inside the loop

* Make the following changes

 - move DeleteAt to subqueries, to avoid select, group by
 - Remove TeamId from response
 - Count bots and webhook posts

* SQL query lint fix, store test fix to include bot messages

* make app-layers

* Fix empty participant lists being sent as [""]

* Track channel joins, to distinguish 0 activity channels vs new channels

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-24 23:14:56 +05:30
Ibrahim Serdar Acikgoz
efbcb0a35a move logger under platform (#20831)
* move logger under platform
2022-08-24 10:10:56 +03:00
Julien Tant
3138543d10 [MM-46468] Change /help and add /marketplace (#20850) 2022-08-23 08:37:06 -07:00
Mattermod
e87a2bbe19 Merge branch 'master' into MM-45118_my_top_dms 2022-08-18 20:42:32 +03:00
Agniva De Sarker
9de6ce5275 MM-46450: Skip flaky TestSearchUsers (#20845)
https://mattermost.atlassian.net/browse/MM-46450

```release-note
NONE
```
2022-08-18 19:53:37 +05:30
Tim Scheuermann
e665542c91 Put wrapped errors into the detailed field on serialization (#20846) 2022-08-18 14:22:12 +02:00
Agniva De Sarker
d9d75b1a7d MM-45198: Migrate app/import and api4/import (#20799)
We migrate them to use logger context.

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

```release-note
NONE
```
2022-08-17 19:58:52 +05:30
Amy Blais
6aa57e6242 Revert "MM-45272: Fix getPostThread permissions (#20565)" (#20811)
Automatic Merge
2022-08-12 18:43:49 +03:00
Shivashis Padhi
582812f1fc Merge branch 'master' of github.com:mattermost/mattermost-server into top-dms-clean 2022-08-12 17:00:55 +05:30
Martin Kraft
55b3961b98 MM-45120: Track team join times. Add API to retrieve new team members since a given time. (#20708)
* MM-45120: Starts tracking team join time. Adds API to retrieve team members who joined after a given time.

* MM-45120: Updates json casing to match model.User.
2022-08-11 10:38:52 -04:00
Shivashis Padhi
e5c1b17d77 Lint fixes 2022-08-11 12:19:25 +05:30
Shivashis Padhi
4ec3eade3b Merge branch 'master' of github.com:mattermost/mattermost-server into top-dms-clean 2022-08-10 21:00:57 +05:30
Tim Scheuermann
1738bd6e92 [MM-45991] Check and return JSON errors (#20735) 2022-08-10 10:56:58 +02:00
Tim Scheuermann
b4570afa90 Replace deprecated ioutil with io and os (#20776)
* Replace ioutil with io and os

* Replace ioutil in utils/file.go

* Minor fix to tests and excluded files

Co-authored-by: Tim Scheuermann <tim.scheuermann@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-09 14:25:46 +03:00
Agniva De Sarker
97b3ffd7ea MM-43202: Change some 501 response codes to fix SLO violations (#20767)
There were lots of cases where we were using the code 501
in an incorrect manner, and since 5xx codes are considered
as SLO violations, these were flagged by our monitoring incorrectly.

These were the guidelines to change the codes:
1. Any case of missing license or config not correctly enabled
is set as Forbidden. The logic is that the user is correctly
authenticated with a session, but does not have enough privileges
to have the higher license, or hasn't changed the config correctly.
2. Any case of incorrectly formed request is obviously a 400.

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

```release-note
NONE
```
2022-08-08 20:02:49 +05:30
Agniva De Sarker
b826421716 MM-45534: Fix flaky TestCreateGroupChannel (#20781)
The returned elements weren't in a specific order.
Therefore, we need to perform an order insensitive match.

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

```release-note
NONE
```
2022-08-08 14:14:18 +05:30
Mattermod
4fc8ef0125 Merge branch 'master' into MM-45118_my_top_dms 2022-08-05 09:56:52 +03:00
Pablo Andrés Vélez Vidal
e7156476fa MM-45542 - do not fail if site url is not set when requesting trial (#20713)
* MM-45542 - do not fail if site url is not set when requesting trial

* remove unnecessary text

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-03 23:54:43 +02:00
Ibrahim Serdar Acikgoz
ac79a887a2 Move metrics under platform service (continued) (#20732)
* move metrics into platform

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2022-08-02 10:59:29 +03:00
Vishal
276594608c Remove the read_channel permission to unfollow a thread (#20662) 2022-08-02 12:12:41 +05:30
Shivashis Padhi
d5f5d18fa9 Lint fix 2022-08-01 14:38:32 +05:30
Agniva De Sarker
55f64195b1 MM-45195: Use api4/bot and app/bot to use logger context (#20729)
https://mattermost.atlassian.net/browse/MM-45195

```release-note
NONE
```
2022-08-01 13:48:45 +05:30
Mattermod
8a532c0b8c Merge branch 'master' into MM-45118_my_top_dms 2022-07-29 10:46:32 +03:00
Agniva De Sarker
887bc0173e MM-45715: Fix incorrect permissions (Round 2) (#20731)
We missed a case to return if there are no
items in the slice. Otherwise it falls through
and returns false incorrectly.

Rectified the tests to trigger the case.

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

```release-note
NONE
```
2022-07-29 09:58:44 +05:30
Tim Scheuermann
832736da37 [MM-45990] log JSON parsing errors in API4 (#20724) 2022-07-28 17:05:03 +02:00
Ashish Bhate
04cd6d35e9 MM-45272: Fix getPostThread permissions (#20565)
Summary
Fix permissions for the the getPostThread API Method.
User can view thread if user is member of the channel
User can view threads in public channels (in the user's team) that they're not a member of, only if compliance export is disabled.

Ticket Link
https://mattermost.atlassian.net/browse/MM-45272
2022-07-28 20:25:20 +05:30
Pablo Andrés Vélez Vidal
0ee05ce054 MM-45713 - change 500 error to json object (#20682)
* MM-45713 - change 500 error to json object

* validate possible encoding errors and follow standards

* replace normal debugging string with true string

* use bool type instead of string

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-28 15:07:54 +02:00
Shivashis Padhi
f007d94155 Ignore self DMs 2022-07-28 12:46:18 +05:30
Agniva De Sarker
0e75cecc4f Fix bad merge due to https://github.com/mattermost/mattermost-server/pull/20674 (#20728)
```release-note
NONE
```
2022-07-28 10:34:02 +05:30
Agniva De Sarker
d4b710b3ab MM-45194: Switch app/user and api4/user to logger context (#20674)
```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-28 10:04:21 +05:30