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

199 Коммитов

Автор SHA1 Сообщение Дата
Jesse Hallam
291d5a2ba7 fix missing newline in upgrader.go (#30853) 2025-04-25 11:21:37 -03:00
Daniel Espino García
71334c6d8b Report a problem (#30444)
* Add report a problem type and allow logs config

* Improve device type logic

* Add tests and minor fixes

* Add texts

* Fix tests by avoiding circular dependencies

* Fix test

* Fix useexternallink updating mailtos, and changing the content of query parameters

* Fix texts

* Fix e2e test

* Fix tsc

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-04-25 11:08:39 +02:00
kasyap dharanikota
ae046fb34e fix: handle error from InvalidateAllCaches in slack.go (#30606)
* fix: hanlde error from InvalidateAllCaches in slack.go

* change signature of InvalidateAllCaches to *model.AppError

* return  err from InvalidateAllCaches everywhere

* Formatting

---------

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2025-04-14 10:24:21 +02:00
Miguel de la Cruz
3ab0da1648 Adds direct participants to the channel invite (#30404)
* Adds direct participants to the channel invite

The channel invite now contains the sanitized users that are local to
the node that is sending the invite. In the event that the receiving
server doesn't have those users in its local database, it can create
them from the invite and correctly generate the DM or GM with them as
members.

* Use IsRemote instead of directly checking user attributes

---------

Co-authored-by: Miguel de la Cruz <miguel@ctrlz.es>
Co-authored-by: Mattermost Build <build@mattermost.com>
2025-04-10 19:19:59 +02:00
Miguel de la Cruz
89ca647330 Unshares a channel when uninviting the last remote (#30568)
Co-authored-by: Miguel de la Cruz (aider) <miguel@ctrlz.es>
Co-authored-by: Mattermost Build <build@mattermost.com>
2025-04-10 15:23:38 +02:00
Harshil Sharma
a9f09cadc2 Premium SKU (#30396)
* Added premium SKU

* removed duplicate enterprise license check functions

* Added license check on API layer

* lint fix

* lint fix

* refactured signature:

* test: Add comprehensive tests for license tier check functions

* fixed test

* text update

* optimised license checks

* fixedf test

* Updated license valid function

* webapp license checks

* handling prekium SKU in webappp:

* added plugin api method and general refactoring

* Updated tests

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-04-03 13:07:54 +05:30
Julien Tant
c440a3223e [MM-63513] Turn Cross team search feature flag into a setting option (#30518)
* feat: Add EnableCrossTeamSearch configuration option to ServiceSettings

* feat: Add EnableCrossTeamSearch configuration option to ServiceSettings

* feat: Enable cross-team search by default

* include old FF in client config
2025-03-26 10:37:12 -07:00
Claudio Costa
d66fbd1425 Implement BenchmarkFileStore (#30524) 2025-03-25 11:42:13 -06:00
Ben Schumacher
9b5d8d52bf [MM-62427] Add message attachments validation (#30180)
* Add message attachments validation

* Add props validation

* Validate slack attachment fields

* Update tests and library usage

* Improve interactive dialog error for length checks

* Allow predefined colors for slack attachments

* Fix TestPostAction

* Use const for data source

* Add tests

* Cleanup unused props

* Add happy path tests

* lint fixes

* Add validation for PostActionOptions
2025-03-20 12:53:50 +01:00
Alejandro García Montoro
350714f390 Bump Go to v1.23.7 (#30455)
* Update Go version to v1.23.7

* Bump golangci-lint to a version supporting Go 1.23

* Fix golangci-lint warnings

Several rules from gosimple, revive and staticcheck linters were
failing:
- Redefinition of built-in identifiers (max, min, new, recover...)
- Use of printf-like functions with simple strings
- Check for nil slices, when len already takes it into account

* Trigger Build

* Trigger Build

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-03-17 14:22:07 +01:00
Christopher Poile
c049748b88 [MM-63314] Fix ClaimJob in HA environments (#30383)
* ClaimJob now returns newly claimed job

* internal code affected by change

* test changes required

* two branches: for mysql, use transaction; for postgres, use returning

* two branches: for mysql, use transaction; for postgres, use returning

* use same millis value for LastActivityAt and StartAt

* blank commit

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-03-14 10:24:26 -04:00
Agniva De Sarker
ac10bb12a5 Revert "Bump Go version to 1.23.6 (#30242)" (#30359)
This reverts commit acbbd4c58d.
2025-02-27 14:58:51 +05:30
Doug Lauder
a732962f0a add readme to the remotecluster and sharedchannel service directories (#30123) 2025-02-26 19:35:54 +01:00
Alejandro García Montoro
acbbd4c58d Bump Go version to 1.23.6 (#30242)
* Bump Go version to 1.23.6

* Update CodeQL Github action as well

* Use server's Go version for CodeQL action

Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>

* Empty commit to trigger CI

* Bump golangci-lint to a version supporting Go 1.23

* Fix golangci-lint warnings

Several rules from gosimple, revive and staticcheck linters were
failing:
- Redefinition of built-in identifiers (max, min, new, recover...)
- Use of printf-like functions with simple strings
- Check for nil slices, when len already takes it into account

---------

Co-authored-by: Antonis Stamatiou <stamatiou.antonis@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2025-02-26 16:43:04 +01:00
Agniva De Sarker
4e5cb16955 MM-62079: Using a cache prefix to isolate cache keys for each test (#30261)
```release-note
A new config setting CacheSettings.RedisCachePrefix has been added which can be used to add a prefix to all Redis cache keys.
```
2025-02-25 09:22:15 +05:30
Ibrahim Serdar Acikgoz
a7905541b8 [MM-62660] Makefile: add ability to run local file store tests as standalone (#30260)
* server/Makefile: add ability to test&benchmark local file store only

* remove benchmark
2025-02-19 10:18:07 +01:00
Agniva De Sarker
c4718e4542 MM-60211: Bump dependencies (#30005)
https://mattermost.atlassian.net/browse/MM-60211
```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-02-06 21:48:08 +05:30
Harshil Sharma
35e776d805 Removed Elasticsearch and Opensearch channel index schedma check (#30102) 2025-02-06 11:50:37 +05:30
Jesús Espino
f1acdce42c Removing opentracing (#29965)
* Removing opentracing

* Fixing CI
2025-01-29 07:45:13 +01:00
Agniva De Sarker
afbd9d64c3 [AI assisted]: MM-62295: Search and index archived channels as well. (#29796)
We add a new field delete_at in the channels template.

This field is then searched in the SearchChannels function.

Also added tests to verify that archived channels are searched
properly, and also indexed correctly.

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

```release-note
- Now archived channels are searchable with ES/OS if TeamSettings.ExperimentalViewArchivedChannels is enabled.
- If there are old channels which were archived before a bulk index was run, users would need to purge indexes, and do bulk index again. Because those old archived channels are removed from the index when a bulk index is run.
```


Co-authored-by: Mattermost Build <build@mattermost.com>
2025-01-28 19:44:55 +05:30
Christopher Poile
737bed311c MM-60115, MM-62436, MM-62493: Compliance export downloads from local and s3; e2e tests (#29806)
* add ZipReader method to filestore and file/s3 backends

to merge

to merge

* add WriteStreamResponse as an alternative to WriteFileResponse

* add generated layers

* enable download link; download job endpoint now streams export dir zips

* fix MM-62493

* re-enable e2e tests--we have download links, folks

* Add tests for ZipReader in filestore and s3store

* remove unnecessary error return on ZipReader

* little cleanup

* improve tests; some refactoring: s.Nil(err) -> s.NoError(err)

* blank commit

* backwards compatability for pre-10.5 job downloads

* compress file response; better errors; better comments; PR comments

* update generated app layers

* improve/widen tests; improve comments; simplify localstore ZipReader

* regenerate layers

* follow GoDoc conventions

* update generated layers

* remove unnecessary comment

* in jobs/job-id/download, clean exportDir before sending to ZipReader

* better comments; add an error return on ZipReader

* improve file permissions

* adjust tests for new error returns

* linting

* i18n
2025-01-27 09:28:07 +05:30
Agniva De Sarker
53d6f59ff5 shared/filestore: Add detailed error context for S3.TestConnection (#29838)
We were just returning a string without embedding the
actual error returned. This was making things difficult
to debug.

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2025-01-17 20:11:22 +05:30
Harshil Sharma
6e5a67caec Feature edit attachments (#29769)
* Updated patch/update post API to allow file modification (#29447)

* WIP

* WIP

* Atatched new files ton post

* WIP: deleting removed files

* Deleted removed files and invalidated file metadata cache

* removed file ignore logif from update post API

* Added TestFindExclusives

* Added tests for DeleteForPostByIds

* Added app layer tests

* Added tests

* Added API level tests

* test enhancements

* Fixed a test

* Edit history include file metadata (#29505)

* Send file metadata in edit history metadata

* Added app tests

* Added store tests

* Added tests for populateEditHistoryFileMetadata{

* Added cache to avoid repetitigve DB calls for edits with only message changes

* Added API tests

* i18m fix

* removed commented code

* Improved test helper

* Show attachments in edit history RHS (#29519)

* Send file metadata in edit history metadata

* Added app tests

* Added store tests

* Added tests for populateEditHistoryFileMetadata{

* Added cache to avoid repetitigve DB calls for edits with only message changes

* Added API tests

* i18m fix

* WIUP: displa files in edit

* removed commented code

* Displayed file in edit history

* Handled file icon

* Fixed closing history component on clicking on file

* Simplified selector

* Simplified selector

* Improved test helper

* Disabled action menu on edit history file

* Added tests

* Improved selector

* Updated snapshot

* review Fixes

* restructured componnets

* Updated test

* Updated test

* Restore post api (#29643)

* Restore post version API WIP

* Undelete files WIP

* Added store tests

* Created post restore API

* Updated updatepost safeUpdate signature

* review fixex and improvements

* Fixed an app test

* Added API laer tests

* Added API tests and OpenAPI specs

* Fixed a typo

* Allow editing files when editing posts (#29709)

* WIP - basic view files when editing post

* Cleanup

* bg color

* Added text editor tests for files

* WIP

* WIP

* removed debug log

* Allowed admin to add and remove files on someone else's post

* Handled drafts and scheduled posts

* linter fixes

* Updated snapshot

* server test fix

* CI

* Added doc

* Restore post api integration (#29719)

* WIP - basic view files when editing post

* Cleanup

* bg color

* Added text editor tests for files

* WIP

* WIP

* removed debug log

* Allowed admin to add and remove files on someone else's post

* Handled drafts and scheduled posts

* linter fixes

* Updated snapshot

* server test fix

* Used new API to restore post

* handled edut limit and undo

* lint fix

* added comments

* Fixed edit post item tests

* Fixed buttons

* Aded snapshots

* fix test

* Updated snapshot

* Minor fixes

* fixed snapshot

* Edit file dnd area (#29763)

* dnd wip

* DND continued

* Supported multiple unbind dragster funcs

* lint fixes

* Got center channel file drop working when editing a post

* file dnd working with center channel and rhs

* file dnd working with center channel and rhs

* removed unneeded stopPropogation calls

* cleanup

* DND overlay fix

* Lint fix

* Advanced text editor test updates for file upload overlay

* fixed use upload hook tests

* Updated some more snapshots

* minor cleanup

* Updated i18n

* removed need of array for dragster unbind events

* lint fixes

* edit history cursor

* Fixed bugu causing faliure to delete empty posts (#29778)

* Files in restore confirmation (#29781)

* Added files to restore post confirmation dialog

* Fixed post restore toast colors

* Fixed restore bug

* Fixed restore confirmation toast tests

* a11y improvement and modal width fix

* Edit attachment misc fixes (#29808)

* Removed single image actions in restore post confirmation dialog

* Fixed file drop overlay size and position

* Made edit indiator accessible

* Lint fix

* Added bunch of more tests

* ANother test migrated from enzyme to react testing library

* More test enhancements

* More test enhancements

* More test enhancements

* lint fixes

* Fixed  a test

* Added missing snapshots

* Test fixes
2025-01-13 18:16:56 +05:30
Agniva De Sarker
833578741d Improve Redis failure modes (#29405)
While investigating code paths during
Redis downtime, I found out that the library
by default retries indefinitely for read commmands.

This leads to it being stuck in a loop
while trying to read anything from Redis.
We fix that by disabling retry.

Secondly, we adjust the ConnWriteTimeout
value slightly from its default of 10s
which is a bit too high for normal working
conditions.

Ref: https://github.com/redis/rueidis/issues/680
```release-note
NONE
```
2024-12-03 09:34:47 +05:30
catalintomai
c98f0f3a0f MM-60487: Consolidate config telemetry (#28200) 2024-11-25 17:35:25 +00:00
Ben Schumacher
053d0b5f0a [MM-61140] Allow plugins to add Support Packet data without UI elements (#28833)
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2024-11-13 11:20:39 +01:00
Nadav Tasher
5e47c97db4 Added support for S3 storage classes (#28319)
* Added support for S3 storage classes

* Added missing translations for S3 storage class

* Changed default storage class values to preserve original behaviour

* Changed storage class description and example

* Fix translations ordering

* Change configuration defaults to empty strings

* Remove redundant empty string check

* Validate storage class variable against constants from S3 API docs

* Validate export storage class against constants

* Use slices for config validation

* Applied patch for translation ordering
2024-11-13 12:29:44 +05:30
Nicolas Le Cam
c90e562528 Migrate mockery to packages feature (#29013) 2024-11-07 12:48:11 +01:00
Harshil Sharma
f812104a92 MM-60331 - Scheduled post telemetry (#29132)
* Added scheduled posts telemetry

* Tracking scheudled post creation via webapp to filter by platform

* Fixed keys

* Lint fix
2024-11-06 10:39:52 +00:00
Guillermo Vayá
751d84bf13 [MM-59363] Shared channel event telemetry (#29024)
* shared channel event tracking

* Update notification.go

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>

---------

Co-authored-by: Miguel de la Cruz <miguel@mcrx.me>
2024-11-05 16:26:18 +01:00
Ben Schumacher
2424358b7d [MM-61302] Use model.NewPointer throughout the code base (#28957) 2024-10-29 13:29:53 +01:00
Guillermo Vayá
a532b70317 [MM-59361] custom groups & read only channels (#28892)
* added group mention, read only view and post event tracking

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-10-28 13:41:29 +01:00
Miguel de la Cruz
98d341fbae Return an error if an invite for a confirmed remote cluster is received (#28943)
Co-authored-by: Caleb Roseland <caleb@calebroseland.com>
2024-10-25 11:30:29 +02:00
Miguel de la Cruz
cb03009992 Adds a feature flag to control availability of DMs in shared channels (#28920)
* Adds a feature flag to control availability of DMs in shared channels

* Reverse feature flag wording
2024-10-24 19:38:00 +02:00
Ibrahim Serdar Acikgoz
a8cf496e31 [MM-61213] Limit file size for slack import file uploads (#28904) 2024-10-24 19:06:14 +02:00
Daniel Espino García
2d96053012 Use flags for create post (#28857)
* Use flags for create post

* Remove unintended file

* Fix unintended change and types

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-10-22 16:00:26 +02:00
Miguel de la Cruz
30cb527cf6 Forbid users from creating DMs and GMs with remote users (#28855)
* Forbid users from creating DMs and GMs with remote users

This change prevents the application from creating new DMs and GMs
when remote users are involved, and prevents as well new posts from
being created into preexisting DMs and GMs with remote users created
in previous versions.

* Adds i18n

* Skip preexisting DM tests and create a new one for the new behavior
2024-10-18 11:16:29 -06:00
Caleb Roseland
fcded9559c MM-61032: Add default_team_id to accept invite flow (#28841)
* add default_team_id to accept invite api

* add team selector to accept invite flow UI

* e2e

* lint/i18n
2024-10-18 12:26:38 +02:00
Agniva De Sarker
a190fe8503 MM-59947: Remove the remaining **model.User special casing (#28707)
We remove the remaining special casing for **model.User
and add unit tests to lock in the behavior.

Additional load tests were done locally to confirm
there are no hidden code paths left out.

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

```release-note
NONE
```
2024-10-14 21:03:01 +05:30
enzowritescode
991debeb0b Change log level inside sendMail() (#28669)
* Change log level inside sendMail()
2024-10-09 14:01:01 -06:00
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
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
Julien Tant
d1cad8c692 add reuse check on update MFA (#28304) 2024-09-27 17:35:36 +02:00
Agniva De Sarker
9900151fb6 Remove some dead code from Redis (#28313)
I forgot to remove this method in my
earlier refactoring. A bit weird that no linter
caught this. 🤔

```release-note
NONE
```
2024-09-25 22:05:46 +05:30
Guillermo Vayá
343746c4b6 MM-59954 Community plugins telemetry (#28226)
* add known plugins to the list of possible plugins to be located

* improve testing and fix config data collection

* Improve testing

* remove empty lines

* make linter happy

* go through all plugins
2024-09-23 12:59:19 +02:00
Miguel de la Cruz
8a735f1b03 Add a specific error when inviting a remote cluster to a remote channel (#28255) 2024-09-19 14:27:41 -05:00
Agniva De Sarker
7be7a47fd3 MM-59933: Increment/Decrement the member count directly (#28196)
While using Redis, there is no need to invalidate
and then update the new count from the DB when
we know the exact number it is going to be incremented
or decremented by.

In that case, we can directly use Redis primitives
to update the cache and prevent yet another DB query.

To achieve this, we modify the LRU cache get/set
paths slightly to not marshal into byte slices
for *int64 values. This is needed for Redis to operate
the INCR/DECR commands.

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

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-09-19 09:38:38 +05:30
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
Agniva De Sarker
f18323980f MM-60413: Fix issues due to incorrect cache provider (#28181)
We were using a mock cache provider which mixed up LRU caches
with each other. This led to incorrect unmarshalling method calls.

We fix this by using the real cache provider.

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

```release-note
NONE
```
2024-09-17 09:37:54 +05:30
Julien Tant
1909206e16 [MM-59069] Make sure OTP are actual One Time Password (#28074)
Automatic Merge
2024-09-17 00:44:32 +02:00