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

526 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
a258fd80b2 Remove remaining references to model.NewXX (#28678)
And we remove the deprecated functions to force uses
only of the new function.
```release-note
NONE
```
2024-10-10 22:15:22 +05:30
Agniva De Sarker
3db139f746 Removed the max/min family of functions (#28679)
They are in-built in Go now
```release-note
NONE
```
2024-10-10 22:14:21 +05:30
Ben Cooke
b3c7ef0b97 [MM-56073] MMCTL delete post command (#27539)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2024-10-08 16:45:31 +02:00
Jesse Hallam
e9968792b0 Emit license details to logs when added or removed (#28333)
* log when changing the license

* handle test licenses without features or customer data

* skip logLicense if logger not setup
2024-10-07 12:48:03 -03:00
Guillermo Vayá
662e59865c MM-59360 add telemetry for paid features related to guests (#28295)
* add telemetry for paid features related to guests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-10-07 13:30:19 +02:00
Ben Schumacher
f3eee28f56 [MM-60253] Avoid unnecessary cache clearing during LDAP sync (#28300) 2024-10-03 16:26:53 +02:00
Daniel Espino García
da6b40665a Avoid resetting device id when removed from push proxy (#28269)
* Avoid resetting device id when removed from push proxy

* Fix test and minor improvements

* Add MySQL support
2024-10-03 10:09:25 +02:00
Scott Bishel
0048723ccd MM-60679 - Validate playbook plugin version, based on license (#28366)
Automatic Merge
2024-10-02 20:14:32 +02:00
Pablo Vélez
1690e48db6 MM 60222 - apply filter to export csv (#28212)
* MM-60222_apply filter to export csv

* get the report exporting with the filters ready

* add unit tests

* cover one more file with some tests

* style the confirm modal note

* add translations

* remove unnecessary print line

* disable export button if there is no data to export

* fix linter issues

* fix linter errors

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-10-02 12:23:39 +02:00
Harrison Healey
76021c76a0 MM-60351 Use oEmbed for YouTube links (#28312)
* Split up handling of permalinks and other links in getLinkMetadata

* MM-60351 Use oEmbed for YouTube links

* Explicitly request json from the oEmbed provider

* Fix linter

* Fix type of CacheAge field

* Address feedback
2024-10-01 14:06:45 -04:00
Ben Schumacher
2b426573cd [MM-60619] Annotate cluster logs messages (#28268) 2024-09-27 09:17:16 +02:00
Devin Binnie
d58b048965 [MM-60603] Don't follow threads when marking them as read on focus (#28263)
* [MM-60603] Don't follow threads when marking them as read on focus

* Fix tests

* Fix lint

* Fix the original bug in the API call
2024-09-26 09:02:11 -04:00
Ben Schumacher
20ed58906a [MM-60307] Check if session is nil before calling UpdateLastActivityAtIfNeeded (#28254) 2024-09-26 13:52:59 +02:00
Daniel Espino García
1e8ef05338 Fix missing profile messages on notification dashboards (#28297) 2024-09-25 12:07:24 +02:00
Agniva De Sarker
9447cb9074 MM-60171: Using a generic function to allocate values (#28245)
We sprinkle a bit of generic magic to refactor a lot
of duplicate code.

To avoid exposing unnecessary code, I duplicated the function
twice. But let me know if you have strong opinions about this.

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

```release-note
NONE
```


---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-25 10:00:14 +05:30
Harrison Healey
46cad5c552 MM-59854 Fully allow at mentions in message attachment field values and add E2E tests (#28018)
* Add descriptions to test cases for getNeededAtMentionedUsernames

* MM-59854 Load users who are at-mentioned in message attachment fields

* MM-59854 Add server support for at-mentioning users in message attachment fields

* Migrate support/external_commands from JS to TS

* MM-59584 Ensure that at-mentions never show in other message attachment fields

* MM-59584 Add E2E tests for how we load users based on at mentions

* Use new E2E test helpers in other places

* Update snapshots
2024-09-24 09:41:03 -04:00
Daniel Espino García
040838b056 Add metrics for mobile versions snapshots (#28191)
* Add metrics for mobile versions snapshots

* Add notifications disabled and fix lint

* Address feedback

* Verify all references to JobTypeActiveUsers

* Fix typos

* Improve platform values

* Add test and MySQL support
2024-09-24 12:02:19 +02:00
Agniva De Sarker
d45a54a8e9 MM-60480: Do not invalidate channel member cache on login (#28143)
On user login, we were aggressively clearing the channel member
cache when it wasn't necessary. There is no channel membership
info that is changing on a user login.

Additionally, we fix some more issues with pointer passing
to the cache. It's a known problem that our value passing
style isn't consistent when we fetch items from cache.
Sometimes we pass pointer-to-pointer, sometimes it's just a
pointer. This is also the reason for https://github.com/mattermost/mattermost/pull/27830.

We fix 2 such cases where we passed pointer-to-pointer
but didn't handle the special case inside the cache.
This time, we actually fix it in the app layer instead
of the cache layer and also add a test for good measure.

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

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-24 13:01:19 +05:30
Ben Schumacher
40d2ae97f1 [MM-60307] Fix racy use of session in NewWebConn (#28195) 2024-09-19 14:10:17 +02:00
Agniva De Sarker
75ed2860ac MM-59934: Add Redis to CI and other improvements (#28164)
- Update library version.
- Added MaxFlush delay to help reduce CPU usage.
- Fall back to LRU cache for the caches which use SCAN.
- Added mattermost-redis and running for all api layer
tests in Postgres.

https://mattermost.atlassian.net/browse/MM-59934
```release-note
NONE
```
2024-09-18 19:13:44 +05:30
Ibrahim Serdar Acikgoz
075681a412 [MM-59359] imports/import_validators.go: add openid to auth_service validation (#28082) 2024-09-17 07:13:54 +02:00
Julien Tant
1909206e16 [MM-59069] Make sure OTP are actual One Time Password (#28074)
Automatic Merge
2024-09-17 00:44:32 +02:00
Ibrahim Serdar Acikgoz
c7ae41b635 [MM-60278] app/config.go: add a nil check for a required field (#28064)
* app/config.go: add a nil check for a required field

* Apply suggestions from code review

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>

---------

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-16 15:24:01 +02:00
Miguel de la Cruz
d2c69fbf95 Changes the event to send when a channel is shared or unshared (#28183)
* Changes the event to send when a channel is shared or unshared

Before we were sending the CHANNEL_CONVERTED websockets event, which
is intended to notify of a public channel being converted into a
private one, so the interface was showing the channel as private until
the client was refreshed.

Now a full channel update event is sent when the channel is shared or
unshared, so the interface gets the new information correctly.

* Fix message type on command tests
2024-09-13 21:40:02 +00:00
Miguel de la Cruz
cae456de2d Adds includeDeleted flag to get remote cluster app and store methods (#28182) 2024-09-13 23:08:53 +02:00
TheInvincible
190d4c48b4 MM-56994 Used false as default for useMilitaryTime (#28128)
* used false as default for useMilitaryTime

* added test for user time-format preference
2024-09-13 13:43:54 -04:00
Nick Misasi
6cece9faa6 Update download app link in Cloud welcome email (#28123) 2024-09-13 10:53:29 -04:00
Ben Schumacher
70fe2abea6 [MM-57194] Allow plugins to mark setting fields as secret (#27986)
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
2024-09-12 19:23:57 +02:00
Miguel de la Cruz
f8202309ce Adds logical deletes to shared channel remotes and remote clusters (#28159)
* Adds logical deletes to shared channel remotes and remote clusters

Instead of physically deleting the shared channel remote and remote
clusters records when a channel is unshared, a remote uninvited or a
remote cluster is deleted, now those have a logical `DeleteAt` field
that is set.

This allows us to safely restore shared channels between two remote
clusters (as of now resetting the cursor without backfilling their
contents) and to know which connections were established in the past
and now are severed.

* Delete the index in remoteclusters before adding the new column

* Fix bad error check
2024-09-12 13:55:11 +02:00
Guillermo Vayá
41bca03270 MM-55208 allow search prefixes (#28146)
* Ignore at and tilde for username and channel searches.

* allow using tilde in search suggestions

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-12 12:19:51 +02:00
Daniel Espino García
af503d9d45 Ignore ack and notification counts if notifications are blocked by the device (#27570)
* Ignore performance counts if notifications are blocked by the device

* Change the endpoint to allow more information

* Add tests and API description

* Remove wrong test

* Address feedback

* Only update the cache when there is no error

* Follow same casing as other props

* use one single endpoint

* Fix tests

* Fix i18n

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-11 18:01:21 +02:00
Agniva De Sarker
b9debc75a0 MM-60478: Do not invalidate session cache on user added to channel (#28142)
PR: https://github.com/mattermost/mattermost/pull/27204 fixed the issue
where `invalidateWebConnSessionCacheForUser` was not broadcasted across
the cluster. However, we became too conservative and started to invalidate
the session cache as well.

But the session cache only contains the session details for the user
and the team membership. There is no channel membership related info.

Therefore, we avoid that and improve performance as well.

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

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-11 20:42:49 +05:30
Ben Schumacher
d9e47522a0 Remove unnecessary copies of loop variables (#28138) 2024-09-11 16:51:30 +02:00
Daniel Espino García
b6bd92f90e Fix mark as unread websocket (#28145)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-11 10:57:46 +02:00
Miguel de la Cruz
b898d13e55 Adds status sync to shared channels (#28020)
* Adds status sync to shared channels

To allow for status to be synced, this changes add a new type of
shared channel internal task. This task has its contents pre-fetched
and stored in the `existingMsg` property, and it is keyed with a user
ID besides a channel ID, so it doesn't conflict with channel-driven
synchronization tasks.

All status synchronizations are triggered from the app layer, so there
is no need of watching for new WebSocket events. Although right now
we're only syncing one user status per message, the changes account
for a list of statuses in case we want to batch them in the future.

The feature is gated by a configuration property and can be disabled
independently of the rest of Shared Channels if it's necessary. It is
backwards compatible as well, and should cause no problems with
servers running older Mattermost versions.

* Adds status sync error management and retry

* Adds DisableSharedChannelsStatusSync to the telemetry report

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-10 21:39:07 +00:00
Miguel de la Cruz
d5e9aa9fb3 Adds ConnectedWorkspacesSettings configuration block (#27820)
* Adds ServerFederationSettings configuration block

The Server Federation related configuration properties were located in
the `ExperimentalSettings` config block. Now that the feature is going
to get out of beta, and foreseeing more configuration properties being
added to it, we're moving them to a block of its own.

If the properties were set in the old location, their values should be
carried over to the new ones. The old properties are left in place and
marked as deprecated not to cause issues with the model.

* Update System Console to include Server Federation section

* Remove system console section

* Move the configuration properties to ConnectedWorkspaces

* Add ConnectedWorkspacesSettings to the telemetry

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-10 22:33:00 +02:00
Scott Bishel
0c585bdac6 MM-59529 Set Channel/Team Admin permissions if All members get set (#28104)
* initial fix

* cleanup code

* move struct back

* fix unit test

* add unit tests

* add comments

* add manage_bookmark permissions

* revert package-lock.json

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-10 11:26:55 -06:00
Claudio Costa
70dc4888fd Simplify thumbnail resizing logic to ensure target constraints are respected (#28012)
Automatic Merge
2024-09-06 21:44:32 +02:00
Harrison Healey
8c5f00da86 MM-60285 Add fresh label to channel and team switch metrics (#28100)
* Changed measureAndReport to take an object as parameters

* MM-60285 Add fresh label to channel and team switch metrics
2024-09-05 16:30:24 -04:00
Ibrahim Serdar Acikgoz
d5cc2eb2f6 [MM-59367] export: enable exporting thread followers for CRT (#27623) 2024-08-29 14:06:41 +02:00
Miguel de la Cruz
3dc0e63c03 Adds Shared Channel related API endpoints (#27436)
* Adds Shared Channel management API endpoints

New endpoints for the following routes are added:

- Get Shared Channel Remotes by Remote Cluster at `GET
/api/v4/remotecluster/{remote_id}/sharedchannelremotes`
- Invite Remote Cluster to Channel at `POST
/api/v4/remotecluster/{remote_id}/channels/invite`
- Uninvite Remote Cluster to Channel at `POST
/api/v4/remotecluster/{remote_id}/channels/uninvite`

These endpoints are planned to be used from the system console, and
gated through the `manage_secure_connections` permission.

* Adds i18n messages for API errors

* Fix pagination flaky test

* Fix linter

* Adds the posibility of filtering shared channel remotes by home

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-08-29 12:46:37 +02:00
Ben Schumacher
5ff680d20d [MM-60262] Respect config store option when creating platform service (#28038)
* Respect config store option when creating platform service

* Remove ConfigStore from ServiceConfig
2024-08-28 07:02:09 +02:00
Ibrahim Serdar Acikgoz
4b3de1861f [MM-59519] preserve DM/GM unread/read state over export and import (#27707) 2024-08-26 17:04:48 +02:00
Domenico Rizzo
e8b5ecd826 MM-57738 - Added GetPluginID function across multiple files (#27960) 2024-08-26 13:39:29 +02:00
Daniel Espino García
e121bebba5 Differentiate remove device error from push proxy (#27998)
* Differentiate remove device error from push proxy

* Fix variable name
2024-08-23 17:43:47 +02:00
Agniva De Sarker
3150900bd7 MM-59827: Remove user profile invalidations from channel APIs (#27720)
We were invalidating the userProfileByIds cache unnecessarily
when it wasn't really needed. It's just that the InvalidateCacheForUser
method wiped off all user related caches, when we just needed to wipe
user-channel related caches.

To fix this, we split the user cache invalidation method into two
and just call the InvalidateChannelCacheForUser method from app/channel.go.

https://mattermost.atlassian.net/browse/MM-59827
```release-note
NONE
```
2024-08-19 20:02:35 +05:30
Julien Tant
5f19d8513b [MM-60026] Add playbooks <v2 in the transitionaslly packaged list (#27903) 2024-08-14 10:22:18 -07:00
Ben Schumacher
bcf92d3f53 Fix flaky TestCreateZipFileAndAddFiles/write_one_file - 2nd round (#27923) 2024-08-13 10:49:05 +02:00
Agniva De Sarker
a1012d33eb MM-59932: Migrate remaining caches to Redis (#27880)
- We introduce 2 new APIs:
1. Scan: this allows incremental iteration
without blocking the Redis server and is the
recommended way to iterate over keys. With this,
we have entirely removed the need for Keys.
2. RemoveMulti: this allows deletion of multiple
keys in a single operation which optimizes
network round trips.

- While here, we make a small improvement to
GetStatusFromCache, where we remove the shallow
copy which wasn't necessary because we always
serialize the data from the cache.
- We do not use Redis for session cache because of
frequent requests to iterate the entire cache which leads
to a lot of `SCAN` calls.
- Avoid broadcasting status update messages for Redis case.
- Setting cache expiry for status cache
- Removing .Set method altogether to prevent
any chances of setting an item with no expiry.

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

```release-note
NONE
```
2024-08-13 14:18:25 +05:30
Ben Schumacher
b5ac317e82 [MM-60152] Fix notifications log file location for Support Packet (#27921) 2024-08-12 14:40:04 +02:00