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

3010 Коммитов

Автор SHA1 Сообщение Дата
Barış
ccab5be6c4 Mm-20223 Add webp emoji support (#20283)
* Added webp package into app/emoji.go , also added a test

* fixed import order inside emoji.go

* Ran go mod tidy

* Conversion to png for Webp emojis that must be resized is implemented

* Deleted unused import

* Added reading mechanism for webp instead of creating

* fileutils and filepath are used while reading a webp file during test

* Deleted readtestwebp function and put it in emoji_test as requested

* Added webp image upload test inside api4/file_test.go

* Expect image is changed from false to true

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-21 10:08:02 +05:30
Doug Lauder
f1ddd3ad38 Revert PR checking for GetUser returning nil,nil (#20508)
Reverts the PR https://github.com/mattermost/mattermost-server/pull/20501 which was added for SET escalation.

It was determined that the plugins call to GetUser never made it to the app layer.
2022-06-20 12:39:45 -04:00
Agniva De Sarker
076454b4f3 MM-45159: Skip flaky TestCreateUserWithInitialPreferences (#20489)
https://mattermost.atlassian.net/browse/MM-45159

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-20 21:33:28 +05:30
Ashish Bhate
7793aebfbb Revert "MM-45000: Change dyatlov dependency (#20443)" (#20506)
This reverts commit 680b00047f.

Reverts the recent opengraph update to fix some issues with our plugins
2022-06-20 20:34:41 +05:30
Shivashis Padhi
2cd83d2f8d [MM-44084] Feature: Top threads insights (#20195)
* Add route endpoints, model, store functions, and tests for top threads

* Run make store-layers

* Make the following changes

 - Fix top user threads query
 - Fix passing parameters in api4/insights.go to handler in app
 - Add top user threads test

* Add post-message, user_id, participants information to insights results

* model.TopThread.UserID -> model.TopThread.UserId, for compatibility with MySQL

* Rename name -> channel_name

* Add user information to response

* Link post in response, filter out deleted root posts from top threads

* Handle thread delete cases, add app tests for threads insights

* lint: fix typo

* lint: rename asserts

* lint: require.nil -> require.NoError

* Add integration tests for thread insights

* Add embeds and images to top posts

* Add license checks for top threads endpoints

* Query users in batch to populate post-creator

* Make the following changes

 - Add license to test server in api4/
 - Add tests for threads insights
    - top team threads shouldn't include threads from other teams, DMs
    - Test duration constraint
    - Pagination testing for top threads in model/insights_test.go

* Add i18n-extract

* i18n fixes

* Add username, nickname to user_information

* Hide message, user_id, post_id, reply_count in depth=1 of top threads response

* Fix tests using response.reply_count to use response.post.reply_count

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-20 10:27:17 -04:00
Agniva De Sarker
de50943d61 jake/gh 20356 (#20485)
* [MM-44667] Set InsecureSkipVerify for S3 when EnableInsecureOutgoingConnections is set

* Cleanup s3New, customTransport

* Lint fixes

* Cleanup s3store_test.go

* Using default transport

```release-note
NONE
```

Co-authored-by: Jake Gutierrez <jakegut0108@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-20 15:42:01 +05:30
Doug Lauder
d4c48139b5 Check for nil,nil returned from GetUser (#20501)
* check for nil,nil returned from GetUser

* add logging
2022-06-17 19:01:50 -04:00
Nathaniel Allred
d43c06ea75 remove freemium feature flag (#20491) 2022-06-17 11:13:22 -05:00
Nick Misasi
cecbcbc8a8 [MM-44887] Consistency in "next billing date" (#20423)
* if there is no trial end date, use the current date for the upgrade confirmation email

* changes

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-16 15:58:07 -04:00
Riccardo Santoni
dd7067cbe9 [MM-44434] Introduced search for channel id's through system console. (#20259)
* Introduced search for channel id's

* Small fix to test case as it is not looking at count

* Introduced searching channels by id as a ChannelOpt. Defaulting to true for system console for the time being

* go fmt

* Modified whether to include search by id by passing it in as prop to search endpoint. Modified webapp to pass through search by id as well

* Fixed issue with full text search, as there is not always necessarily an index on Id.

* Modified test to verify count, and moved code inside conditional

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-16 11:32:16 -04:00
Agniva De Sarker
f15873eaf4 MM-43871: Fix flaky TestCreatePostAsUser (#20484)
We need to flush the logger before checking
the log results. Without that, sometimes
it would get logged after checking the line,
as can be seen in the JIRA ticket.

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

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-16 14:17:01 +05:30
Agniva De Sarker
c7aa2fdbb5 MM-43832: Fix flaky TestReadReplicaDisabledBasedOnLicense (#20483)
The config store was incorrectly initialized. Other than that,
I don't think there is any "flakyness" in the test.

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

```release-note
NONE
```
2022-06-16 12:34:08 +05:30
Tim Scheuermann
eb034fc981 MM-44236 Update server dependencies (#20444) 2022-06-16 08:50:55 +02:00
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