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

2997 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
680b00047f MM-45000: Change dyatlov dependency (#20443)
* MM-45000: Change dyatlov dependency

https://mattermost.atlassian.net/browse/MM-45000
2022-06-14 16:11:53 +03:00
José Peso
48a9234d69 websocket: drop less important events before they are queued (#20326)
Discard the non-essential WebSocket events before they are queued.

When conn send queue is full, the connection is closed. There are messages that are being dropped by the current mechanism when send queue is at 50% capacity. This change makes the messages drop before entering the queue in order to keep the queue as empty as possible.

The value of the length of the queue could not be 100% accurate since we are reading from the hub goroutine, but it will be accurate enough to avoid some events.
2022-06-14 09:35:22 +02:00
Martin Kraft
182ae1234a MM-43956: Adds post counts by duration. (#20131)
* MM-43956: Adds post counts by day.

* MM-43956: Test data cleanup. Switch from Unix to UnixMilli.

* MM-43956: Changes from selecting date data types to strings in SQL.

* MM-43956: Fixes date format key.

* MM-43956: Adds missing user id scope for 'my' top channels graph.

* MM-43956: Adds the ability to group post counts by hour.

* MM-43956: Require enterprise or professional license. Reject guests.

* MM-43956: Adds license for tests.

* MM-43956: Renames function.

* MM-43956: Omits future hours from post counts by hour.

* MM-43956: Adjust API response grouping to users timezone.

* MM-43956: Adds translation.

* MM-43956: Adds user's timezone to the data tier for the grouping by day and hour.

* MM-43956: Fixes layers.

* MM-43956: Lint fix.

* MM-43956: Fix store layers.

* MM-43956: Switches to default name for time package; changes parameter names to avoid naming conflict.

* MM-43956: Updates mocks.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-13 16:22:34 -04:00
Claudio Costa
d317923143 Fix flaky TestUploadDataConcurrent (#20445) 2022-06-13 09:52:10 +02:00
Ibrahim Serdar Acikgoz
39991d236b Add Product Interfaces (#20403)
* app: improve plugin interfaces

* add documentation

* improve doc

* add error id

* add more info to readme
2022-06-13 09:36:43 +03:00
Agniva De Sarker
7c1b8cd937 MM-43733: Set concurrency limits via configuration (#20413)
```release-note
We create a new config option MaxImageDecoderConcurrency which
indicates how many images can be decoded concurrently at once.

The default is -1 which means number of CPUs present.

This affects the total memory consumption of the server. The
maximum memory of a single image is dictated by MaxImageResolution * 24 bytes.
Therefore, a good rule of thumb to follow is that MaxImageResolution
* MaxImageDecoderConcurrency * 24 should be less then the allocated memory for
image decoding.
```

https://mattermost.atlassian.net/browse/MM-43733
2022-06-11 00:24:46 +05:30
Julien Tant
35d473b3a0 [MM-44995] remove reference to 30 days trial in welcome email (#20425) 2022-06-09 16:01:24 -07:00
Michael Kochell
e18b1cf89f Check for cloud license and CWS error when checking integration freemium limits (#20387)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-09 15:57:02 -04:00
Agniva De Sarker
dce96046dd MM-42714: Trim token sizes to 50 characters (#20412)
https://mattermost.atlassian.net/browse/MM-42714

```release-note
NONE
```
2022-06-09 14:56:26 +05:30
Guillermo Vayá
c6f80dfe0a [MM-44573] Sanitize options (#20380)
Automatic Merge
2022-06-09 00:36:28 +03:00
Ben Cooke
2c63e8dd08 [MM-43785] Hide insights feature intro for new users (#20214)
* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* hide insights modal by default for new users

* updating feature flag for test

* updating preference tests

* fixing lint

* fixing comment

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-08 14:56:34 -04:00
Kyriakos Z
5396c530bf MM-42581: fixes unread threads on user channel add (#20181)
* MM-42581: fixes unread threads on user channel add

Currently when we are adding a user to a channel we don't send previous
values for unread replies and mentions. This is resulting the thread to
not be marked as unread in the UI, since we rely on the previous values
for that.

This commit fixes the issue by returning previous unread values of 0.

* Adds test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-08 14:01:58 -04:00
Agniva De Sarker
f89266532f MM-44922: Skip TestImportImportPost (#20395)
Skipping the test.

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

```release-note
NONE
```
2022-06-08 14:18:42 +05:30
Tim Scheuermann
03579f56ae [MM-43831] removed the parallel marker from the subtests (#20364) 2022-06-08 09:08:45 +02:00
Claudio Costa
159ebc297d Pre-package Calls v0.6.0 and enable it by default (#20388)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-07 19:45:43 +02:00
Agniva De Sarker
319a2b2428 MM-39690: Clean up some unnecessary logs (#20368)
These logs would appear at every request
and didn't have any useful info for the admin.
It was more of a developer logging thing
and therefore removing it.

https://mattermost.atlassian.net/browse/MM-39690
```release-note
NONE
```
2022-06-07 21:21:36 +05:30
Ibrahim Serdar Acikgoz
c1c084a596 app/plugin: add product middleware and enable products register their routers (#20374) 2022-06-07 09:12:15 +03:00
Vishal
27fc14201f [MM-42192] Include deleted posts in GetPost (#20358)
* Introduced include_deleted query param on get posts endpoint

* Update the correct func name in the comment.

Co-authored-by: santoniriccardo <santoni.riccardo@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-06 13:29:42 +05:30
Ashish Bhate
456299841a MM-44412: correct usage of updateAt to createAt (#20263)
* MM-44412: correct usage of updateAt to createAt

* lint

* correct usage of updateAt to createAt - CRT unsupported

* remove dead code

* remove unrequired tests

* update test name

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-03 12:26:36 -04:00
Ashish Bhate
8f912b697e MM-43918: freemium limit for storage (#20225)
Summary
Adds an API end point to return storage usage

Ticket Link
https://mattermost.atlassian.net/browse/MM-43918
2022-06-03 11:48:29 +05:30
Ashish Bhate
1f6e2fe846 MM-41728: Validate emoji size in app while importing (#20325)
* MM-41728: Validate emoji size in app on import

* use NotNil instead of Error for AppErr

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-02 23:55:40 -04:00
Agniva De Sarker
ec0284b459 MM-44638: Remove upgrade.go (#20309)
We remove any remaining migrations from the upgrade.go file

```release-note
NONE
```
2022-06-02 22:53:12 +05:30
Pablo Andrés Vélez Vidal
c92cbb606a MM-44420 - replace 14-day references with new freemium 30-day (#20349)
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
2022-06-02 18:25:19 +02:00
Ibrahim Serdar Acikgoz
fe3816cc20 store: guests will only receive results of which channels they are in (#20295)
* store: guests will only receive results of which channels they are in

* api4/channel_test: add test case for guest accounts channel autocomplete

* apply to searchengine and also for AutocompleteInTeam

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-01 09:18:59 +03:00
Nick Misasi
cffe921e62 [MM-44475] Team Unarchive: Do not allow to unarchive if workspace has reached the limit of teams (#20281)
* Prevent cloud limited installations from restoring teams when at or above the teams limit

* Code clean up

* fix i18n

* Actually fix i18n

* updates for govet

* Update model/client4.go

Co-authored-by: Vishal <vish9812@gmail.com>

* [MM-44397] Restrict team creation based on subscription limits (#20282)

* restrict team creation based on limits

* Update api4/team.go

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

* Fix tests

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>

* Add additional field to teamsusage

* Fix

* remove useless test

* Fix error for team creation

* Remove apostrophe

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Vishal <vish9812@gmail.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
2022-05-31 15:06:54 -04:00
Vishal
d87fe35bdf [MM-44263] Cache Posts Usage (#20254)
* Fetch users only posts

* Cache Posts Usage

* Explicitly validate posts count before testing usage

* Add DocString

* Revert cache changes

* Revert "Revert cache changes"

This reverts commit ba693f8d5028b62c19f6a730e8dca73a224d0761.
2022-05-31 16:25:46 +05:30
Vishal
57e9aa767c [MM-44263] Only include user posts in post count (#20250)
* Fetch users only posts

* Explicitly validate posts count before testing usage
2022-05-31 14:18:41 +05:30
Ibrahim Serdar Acikgoz
70610a9c96 app/server: add userservice to the service map (#20296) 2022-05-27 14:40:24 +03:00
Ashish Bhate
c5e6d0e1ba MM-43878: don't err when reply createAt before parent createAt (#20292)
Summary
In a bulk import, if the createAt of a reply is older than the createAt of the parent post, then instead of erroring, we log a warning and set the createAt of the reply to that of the parent post.
I checked the exporting logic, there doesn't appear to be away for the reply createAt to be older than the parent createAt, as a side-effect of the exporting logic.

Ticket Link
https://mattermost.atlassian.net/browse/MM-43878
2022-05-27 15:48:00 +05:30
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
Michael Kochell
ea5bfe3fd9 Cloud Freemium - Integrations (#20185)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-25 12:36:08 -04: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
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
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
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
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
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
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
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
Vishal
1092c60bc6 [MM-32692] Add two more CRT options (#20088)
* MM-32692 Add two more CRT options deafult_on and always_on

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-12 12:03:59 +05:30
Agniva De Sarker
231db2df1e MM-43775: Use conn.NetConn() to get TCP conn from tls.Conn (#20180)
We use the new API in Go 1.18 to set TCP_NO_DELAY for tls connections
as well.

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

```release-note
NONE
```
2022-05-11 15:07:30 +05:30
Nick Misasi
340612ec10 Divide TrialEnd date by 1000 to account for it being in ms (#20173)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-10 13:55:21 -04:00
Claudio Costa
aee68c7ae4 [MM-44056] Make Calls plugin's state on Cloud controllable by feature flag (#20161)
* Make Calls plugin's state on Cloud controllable by feature flag

* Prepackage Calls v0.4.9 (#20148)

* Update app/plugin.go

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>

* Update app/plugin_install.go

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>

* Bump Calls version to latest

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-10 19:29:48 +02:00
Ibrahim Serdar Acikgoz
81700598ec app/cluster.go: add PublishWebSocketEvent method (#20171) 2022-05-10 17:25:57 +03:00
Daniel Espino García
50eaec6695 Respect send push proxy notification configuration on test notifications (#20063)
* Respect send push proxy notification configuration on test notifications

* Unify notifications check

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-05-10 12:37:47 +02:00
Ibrahim Serdar Acikgoz
3f921bf170 app/server: shutdown producst before closing the store (#20159) 2022-05-10 10:55:40 +03:00
Nathaniel Allred
6f87eb67fc MM-43084 update product limits through webhook and websocket (#20076)
* Define interfaces for updating subscriptions and product limits from CWS webhook.
2022-05-09 08:05:50 -05:00