Commit Graph

415 Commits

Author SHA1 Message Date
Scott Bishel
82b8d4dc07 MM-55966 - Update ArrayFromJSON to use LimitedReader (#25510)
* update ArrayFromJSON to use LimitedReader

* update for bad merge

* fix lint errors

* update test code

* update unit tests

* update unit tests

* fix unit tests

* use consts, other cleanup

* add non sorting duplicate check

* set config to default value, then config setting if available

* fix lint errors

* fixes and debugs

* fix log test

* remove setting from Client, add unlimited Parser to client

* a couple more fixes

* another fix

* rename some variables

* remove superflous call

* check for valid MaximumPayloadSize

* update language file

* fix for e2e-tests

* update util function to return error

* lint fix

* update config property name to include unit

* fix for unit test

* add new config to telemetry

* call function to create LimitedReader

* Deprecate old function, use new function name

* return new AppError on failed parse

* return new AppError on failed parse

* return new AppError on failed parse

* add constant for i18n valid constants

* Update server/public/model/utils_test.go

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* Apply suggestions from code review

Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>

* update error variable, remove unnecessary check

* Update function names

* fix errors from merge

* update unit test to create unique ids

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Miguel de la Cruz <mgdelacroix@gmail.com>
2024-01-09 10:04:16 -07:00
Doug Lauder
93351ff8a4 Fix error message when sharing already shared channel; also make idempotent (#25854)
* fix appError/error assignment bug

* make ShareChannel plugin API idempotent

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-09 12:42:11 +01:00
Doug Lauder
241e8edc2e Ping new shared channels remotes immediately (#25850)
* option for auto inviting plugin to all shared channels.

* auto-invite remotes to shared channels when flag set

* fix unit test

* immediately ping new remotes; fix unique siteurl bug

* make i18n-extract

* fix translations

* fix merge conflicts

* make modules-tidy

* revert accidental go.mod change

* revert accidental go.sum changes

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-09 12:35:05 +01:00
Doug Lauder
000aa0d891 Plugin API for Shared Channels: support auto invite (#25834)
* option for auto inviting plugin to all shared channels.

* auto-invite remotes to shared channels when flag set

* fix unit test

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-08 18:12:18 +01:00
Jesse Hallam
b05093d508 Source available metrics (#24879)
* Expose metrics under a source available license

* do not assume Cluster()

* allow metrics if licensed or dev

* temporary vet override

* simplify BULID_TAGS handling

* auto clean old imports.go

* fix license listener

* e2e test metrics & license semantics

* update from enterprise

* switch back to mattermost-govet/v2@new now

* update metrics from upstream

* Update license_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update license_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e-tests/cypress/tests/integration/channels/enterprise/metrics/license_spec.js

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>

* Update e2e-tests/cypress/tests/integration/channels/enterprise/metrics/license_spec.js

* split up specs

* require/delete license earlier in e2e test

* expanded expect to debug failures

* more logging

* Revert "more logging"

This reverts commit 0bc513fd92.

* e2e: try deleting license first

* update from enterprise

* toggleMetricsOn to work around license delete

* eslint

* ensure admin before deleting license

* update from enterprise

* updates from enterprise

* fix cypress logging

* temp: log at DEBUG for Cypress tests

---------

Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-08 10:47:24 -04:00
Miguel de la Cruz
6184c36e0b Fix make permission error (#25860) 2024-01-08 14:45:48 +01:00
Miguel de la Cruz
e1a27cf57f Adds a team check to get groups by team (#25462)
* Adds a team check to get groups by team

* Update to take into account groups_by_channel and new permissions

* Update API docs
2024-01-08 13:28:51 +01:00
Nick Misasi
e52940cd08 Lock wrangler behind enterprise (#25703)
* Lock wrangler behind enterprise

* Run tests with SetupEnterprise so Thread Moving is unlocked. Tweak NewTestLicense to include a SkuShortName for 'enterprise'

* Don't set SkuShortName in NewTestLicense just in case. Fix up some old debug code in tests

* Remove checks on enterprise/e20 and just enforce that the workspace has any license

* Update admin_definition.tsx accordingly

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2024-01-05 13:20:37 -05:00
Devin Binnie
ac854498a4 [MM-56266] Check for public channels when getting channel member counts to avoid 403 errors (#25831)
* [MM-56266] Check for public channels when getting channel member counts to avoid 403 errors

* Fix test
2024-01-05 12:28:22 -05:00
Claudio Costa
077221a940 Revert "MM-55295: Improve DB performance of some APIs (#25318)" (#25852)
This reverts commit ec88ab4ee9.
2024-01-05 10:05:37 -06:00
Agniva De Sarker
ca94577cd5 MM-56260: connIndex: safely remove conns while iterating (#25785)
PR https://github.com/mattermost/mattermost/pull/22560
introduced a regression in the case where we had
multiple connections for a single user.

Because if connIndex.Remove was called during the iteration
from connIndex.ForUser, then the slice would be modified
during iteration and if a connection got removed,
then a good connection would move from the last index
to the current index. But since we would be actively
iterating, the last index would be read as nil and we would
never be able to reach the good connection.

We fix this by returning a copy of the original slice
if there are more than one elements in the slice.

https://mattermost.atlassian.net/browse/MM-56260
```release-note
Fix a bug where if there were multiple websocket
connections from a single user, then in case one connection
got removed during a broadcast, there was a possibility
that the other good connection might not get the event.
```
2024-01-04 13:36:22 -06:00
Harrison Healey
59549653a7 MM-56147 Add GetPreferenceForUser plugin API (#25704)
* MM-56147 Add GetPreferenceForUser plugin API

* Change return type to non-pointer for preference consistency

* Fix merge
2024-01-04 13:50:19 -05:00
Ben Schumacher
edc305716f [MM-56284] Remove non-generic StoreResult (#25750) 2024-01-04 12:30:21 +01:00
Harrison Healey
502cd6ef7d MM-56082 Add PreferencesHaveChanged plugin hook (#25659)
* Add interface for PreferencesHaveChanged hook

* Add context to preference-related methods of App

* Implement PreferencesHaveChanged

* Re-add missing "fmt" import

* Update minimum server version for the new hook

* Remove pointers to be consistent with other preference APIs
2024-01-03 12:25:53 -05:00
Harshil Sharma
9016e30044 Fixed user reporting pagination (#25780)
* Fixed pagination and sorting for Postgres

* Updated tests
2024-01-02 10:41:00 -05:00
Felipe Martin
81a1d725a0 [WIP] [MM-55031] OAuth Outgoing Connection App integration (#25379)
* OAuthOutgoingConnection model

* added store

* make generated

* add missing license headers

* fix receiver name

* i18n

* i18n sorting

* update migrations from master

* make migrations-extract

* update retrylayer tests

* replaced sql query with id pagination

* fixed flaky tests

* missing columns

* missing columns on save/update

* typo

* improved tests

* remove enum from mysql colum

* add password credentials to store

* license changes

* OAuthOutgoingConnectionInterface

* Oauth -> OAuth

* make generated

* merge migrations

* renamed migrations

* model change suggestions

* refactor test functionsn

* migration typo

* refactor store table names

* updated sanitize test

* cleanup merge

* refactor symbol

* list endpoint

* oauthoutgoingconnection -> outgoingoauthconnection

* signature change

* i18n update

* granttype typo

* naming

* api list

* uppercase typo

* i18n

* missing license header

* fixed path in comments

* updated openapi definitions

* sanitize connections

* make generated

* test license and no feature flag

* removed t.fatal

* updated testhelper calls

* yaml schema fixes

* switched interface name

* suggested translation

* missing i18n translation

* address comments

* updated i18n
2023-12-26 10:46:20 +01:00
Harshil Sharma
d23c16b9aa Removed user bands (#25806) 2023-12-25 07:11:28 +00:00
Doug Lauder
2d1135ca46 Shared channels plugin APIs for MS Teams plugin (#25805)
New plugin APIs and hooks for accessing Shared Channels service via plugin. 

- RegisterPluginForSharedChannels(opts model.RegisterPluginOpts) (remoteID string, err error)
- UnregisterPluginForSharedChannels(pluginID string) error
- ShareChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error)
- UnshareChannel(channelID string) (unshared bool, err error)
- UpdateSharedChannelCursor(channelID, remoteID string, cusror model.GetPostsSinceForSyncCursor) error
- SyncSharedChannel(channelID string) error
- InviteRemoteToChannel(channelID string, remoteID string, userID string) error
- UninviteRemoteFromChannel(channelID string, remoteID string) error

Hooks
- OnSharedChannelsSyncMsg(msg *model.SyncMsg, rc *model.RemoteCluster) (model.SyncResponse, error)
- OnSharedChannelsPing(rc *model.RemoteCluster) bool
2023-12-22 17:00:27 -05:00
Agniva De Sarker
0496483a9e MM-56359: Skip TestUploadLicenseFile (#25800) 2023-12-22 13:21:33 +01:00
Miguel de la Cruz
0e60f3d542 Improves validation in getRolesByName endpoint (#25215)
* Improves validation in getRolesByName endpoint

* Updates the max constant and fixes linter

* Adds a mechanism to split roles in chunks in the webapp client

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-22 10:29:51 +01:00
dkkb
be24f108e1 Refactor server runJobs function. (#23854) 2023-12-22 09:51:40 +01:00
Harshil Sharma
a59f5ccded Added API to return user count bands and user count (#25796) 2023-12-21 13:00:19 +00:00
Agniva De Sarker
7dcf5f85a5 MM-56071: Track multiple threads (#25775)
We can have 2 types of threads open at the same time. One from
the thread view, and another from RHS.

We add another variable to distinguish between the 2 states.

In future, if we have the ability for more than 2 threads, then
we would need to track by threadID.

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

```release-note
NONE
```
2023-12-21 08:42:58 +05:30
Miguel de la Cruz
3f2351c71f Remove user search skipped test (#25790) 2023-12-20 14:35:04 -06:00
Matthew Straughn
ebdc964161 Mm 16623 fix all initialism errors in channels/app and channels/api4 dir (#25743)
* updated go mod and sum files

* fixed var-naming errors in channels/app and channels/api4 dir

* Revert "updated go mod and sum files"

This reverts commit 088dd00a84.

* renamed a cost .
2023-12-20 06:46:54 +01:00
Doug Lauder
d56dc9d0ce Add Options field to RemoteClusters (#25771)
* add Option flag to RemoteClusters

* add Options column to RemoteClusters table
2023-12-19 13:01:35 -05:00
Ben Schumacher
799ec680bd [MM-29240] Improve buffer handling of UploadEmojiImage (#25536) 2023-12-19 10:00:01 +01:00
Ben Schumacher
1fdddfe678 [MM-53269] Add configuration setting for integration requests timeout (#23805)
Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com>
2023-12-18 16:07:00 +01:00
Paul Stern
f69620f22c [MM-55299] Migrate server/channels/app/notification.go to make use of GenericStoreResult (#25746)
* [MM-55299] Make use of GenericStoreResult

Make use of GenericStoreResult in server/channels/app/notification.go

Introduce new result variables to workaround the IncompatibleAssign
error.

* [MM-55299] Make use of GenericStoreResult

Use GenericStoreResult for profiles, cmn properties, groups map.
Introduce new result variables for them to workaround IncompatibleAssign
error.

* Resolve merge conflict. Accept incoming master's change

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-18 13:13:56 +01:00
Paul Stern
000ee45b5d [MM-55303] channels/app/webhook: Make use of GenericStoreResult (#25722)
Make use of Generic store result in channels/app/webhook.go.
Introduce new variable resultU (result user) to workaround incompatible
assign error (since generics have been introduced).
2023-12-18 07:08:38 +01:00
Devin Binnie
5c061a6f75 [MM-56206] Allow for proper paging and sorting (#25726)
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-18 05:56:06 +05:30
Harshil Sharma
97a23d791e New report router and user reporting refactoring (#25713)
* Added materialized view migration

* Renamed mat view

* Added channel membership mat view and indexes

* Added channel membership mat view and indexes

* Added new index

* WIP

* Simplifying user reporting code

* Created app and API layer for cahnnel reporting, reporting refactoring in general

* New router

* Remobved channel reporting meanwhile

* Upodated autogenerated stuff

* Lint fix

* Fixed typo

* api vet

* i18n fix

* Fixed API vetting and removed channel reporting constants

* yaml

* removed app pagination tests
2023-12-14 10:49:19 -05:00
Agniva De Sarker
9ae451a121 MM-55476: Optimize PostStore.Get (#25448)
While loading a thread, we were unnecessarily re-counting the replies
for all posts in a thread even if they would be the same number.

While this is needed in other queries where the posts can be from different
threads or they can be random ids, but to load a single post thread, there
is no need to recompute it again and again.

Therefore, we use a CTE to precompute the replycount and then just plug in
the value in the subsequent query. This gives an improvement in the query
plan as well:

OLD:
```
explain (analyze, buffers) SELECT p.id, p.rootid, p.createat, (SELECT count(*) FROM Posts WHERE Posts.RootId = (CASE WHEN p.RootId = '' THEN p.Id ELSE p.RootId END) AND Posts.DeleteAt = 0) as ReplyC
ount FROM Posts p WHERE (p.Id = 'h3cer597jb8abbcbitpghpomua' OR p.RootId = 'h3cer597jb8abbcbitpghpomua') AND p.DeleteAt = 0;
                                                                            QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on posts p  (cost=45.39..1042149.61 rows=2748 width=49) (actual time=3.156..7906.215 rows=5353 loops=1)
   Recheck Cond: (((id)::text = 'h3cer597jb8abbcbitpghpomua'::text) OR (((rootid)::text = 'h3cer597jb8abbcbitpghpomua'::text) AND (deleteat = 0)))
   Filter: (deleteat = 0)
   Heap Blocks: exact=5308
   Buffers: shared hit=610244
   ->  BitmapOr  (cost=45.39..45.39 rows=2748 width=0) (actual time=0.918..0.920 rows=0 loops=1)
         Buffers: shared hit=47
         ->  Bitmap Index Scan on posts_pkey  (cost=0.00..1.68 rows=1 width=0) (actual time=0.028..0.028 rows=1 loops=1)
               Index Cond: ((id)::text = 'h3cer597jb8abbcbitpghpomua'::text)
               Buffers: shared hit=4
         ->  Bitmap Index Scan on idx_posts_root_id_delete_at  (cost=0.00..42.34 rows=2747 width=0) (actual time=0.889..0.890 rows=5352 loops=1)
               Index Cond: (((rootid)::text = 'h3cer597jb8abbcbitpghpomua'::text) AND (deleteat = 0))
               Buffers: shared hit=43
   SubPlan 1
     ->  Aggregate  (cost=378.10..378.11 rows=1 width=8) (actual time=1.474..1.474 rows=1 loops=5353)
           Buffers: shared hit=604889
           ->  Index Only Scan using idx_posts_root_id_delete_at on posts  (cost=0.57..343.85 rows=13699 width=0) (actual time=0.016..1.039 rows=5352 loops=5353)
                 Index Cond: ((rootid = (CASE WHEN ((p.rootid)::text = ''::text) THEN p.id ELSE p.rootid END)::text) AND (deleteat = 0))
                 Heap Fetches: 0
                 Buffers: shared hit=604889
 Planning Time: 0.194 ms
 Execution Time: 7906.846 ms
```

NEW:
```
explain analyze with replycount as (select count(*) as num from posts where rootid='h3cer597jb8abbcbitpghpomua' and deleteat=0)
select id, rootid, createat, replycount.num from posts, replycount where id='h3cer597jb8abbcbitpghpomua' or rootid='h3cer597jb8abbcbitpghpomua' and deleteat=0;
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
 Nested Loop  (cost=123.16..3215.48 rows=2748 width=49) (actual time=2.960..9.775 rows=5353 loops=1)
   ->  Aggregate  (cost=77.78..77.79 rows=1 width=8) (actual time=1.455..1.456 rows=1 loops=1)
         ->  Index Only Scan using idx_posts_root_id_delete_at on posts posts_1  (cost=0.57..70.91 rows=2747 width=0) (actual time=0.056..1.145 rows=5352 loops=1)
               Index Cond: ((rootid = 'h3cer597jb8abbcbitpghpomua'::text) AND (deleteat = 0))
               Heap Fetches: 0
   ->  Bitmap Heap Scan on posts  (cost=45.39..3110.20 rows=2748 width=41) (actual time=1.501..7.747 rows=5353 loops=1)
         Recheck Cond: (((id)::text = 'h3cer597jb8abbcbitpghpomua'::text) OR (((rootid)::text = 'h3cer597jb8abbcbitpghpomua'::text) AND (deleteat = 0)))
         Heap Blocks: exact=5308
         ->  BitmapOr  (cost=45.39..45.39 rows=2748 width=0) (actual time=0.797..0.798 rows=0 loops=1)
               ->  Bitmap Index Scan on posts_pkey  (cost=0.00..1.68 rows=1 width=0) (actual time=0.014..0.014 rows=1 loops=1)
                     Index Cond: ((id)::text = 'h3cer597jb8abbcbitpghpomua'::text)
               ->  Bitmap Index Scan on idx_posts_root_id_delete_at  (cost=0.00..42.34 rows=2747 width=0) (actual time=0.782..0.782 rows=5352 loops=1)
                     Index Cond: (((rootid)::text = 'h3cer597jb8abbcbitpghpomua'::text) AND (deleteat = 0))
 Planning Time: 0.220 ms
 Execution Time: 10.052 ms
(15 rows)
```

Observe the `loops=5353` in the first query, and `loops=1` in the next.

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

```release-note
Optimize createPost performance
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-14 14:09:29 +05:30
Daniel Espino García
917a032baf Fix MM53181 (#25684)
* Fix MM53181

* Add tests
2023-12-14 09:32:41 +01:00
Agniva De Sarker
c42ae47948 MM-56071: Thread presence indicator (#25694)
We also track the channelID of the thread opened.

Additionally on every connection create or re-connect
with an existing queue, we reset the active state to empty
to avoid any edge-cases.

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

```release-note
NONE
```
2023-12-13 13:58:40 +05:30
Agniva De Sarker
45ba1dc196 MM-55655: Fix unbounded concurrency in outgoing webhooks (#25511)
We were simply spawning goroutines within goroutines.

For each post, we would spawn one goroutine per hook,
and then one goroutine per callback URL within that hook.
And to top it off, this whole thing was itself within
a goroutine.

To fix it, we remove the goroutine spawning at a per
hook level. And then use a waitgroup to wait
until all hooks from each callback URL is complete.

While here, some other optimizations that we do:
1. We already had the channel object, but inspite of
that, we were calling channel.get again in CreatePostMissingChannel.
We just use CreatePost now and pass the channel.
2. We pre-compile the regex.
3. We store the http.Client in the server to reuse TCP connections.

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

```release-note
NONE
```
2023-12-13 09:39:22 +05:30
Agniva De Sarker
b946dad78d MM-55987: Bypass uploading to S3 for local mode mmctl import (#25591)
We directly instruct the server to read from the local filesystem
in case the local_mode key is set.

There is now no need to upload the file in --local mode and a warning
is thrown accordingly.

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

```release-note
Now the mmctl bulk import process command in local mode supports processing an import file without actually uploading it to the server. Simply pass the file path to the import file and the server will directly read from it, and pass the --bypass-upload flag. There is no need to use the import upload command. NOTE: all of this is applicable only in local mode.
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-13 09:38:00 +05:30
Agniva De Sarker
e0b5b951f1 MM-56060: Create base scaffolding for websocket pub-sub (#25654)
We create a new websocket action called "presence" which
can contain the active_channel and the active_team for a given
client connection.

On the client side, for every channel or team switch, we send
out this message.

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

```release-note
NONE
```
2023-12-12 08:49:09 +05:30
Nick Misasi
f0a336ba07 Feature: Wrangler (#23602)
* Migrate feature/wrangler to mono-repo

* Add wrangler files

* Fix linters, types, etc

* Fix snapshots

* Fix playwright

* Fix pipelines

* Fix more pipeline

* Fixes for pipelines

* More changes for pipeline

* Fix types

* Add support for a feature flag, but leave it defaulted on for spinwick usage for now

* Update snapshot

* fix js error when removing last value of multiselect, support CSV marshaling to string array for textsetting

* Fix linter

* Remove TODO

* Remove another TODO

* fix tests

* Fix i18n

* Add server tests

* Fix linter

* Fix linter

* Use proper icon for dot menu

* Update snapshot

* Add Cypress UI tests for various entrypoints to move thread modal, split SCSS out from forward post into its own thing

* clean up

* fix linter

* More cleanup

* Revert files to master

* Fix linter for e2e tests

* Make ForwardPostChannelSelect channel types configurable with a prop

* Add missing return

* Fixes from PR feedback

* First batch of PR Feedback

* Another batch of PR changes

* Fix linter

* Update snapshots

* Wrangler system messages are translated to each user's locale

* Initially translate Wrangler into system locale rather than initiating user

* More fixes for PR Feedback

* Fix some server tests

* More updates with master. Fixes around pipelines. Enforce Enterprise license on front/back end

* Add tests for dot_menu

* More pipeline fixes

* Fix e2etests prettier

* Update cypress tests, change occurrences of 'Wrangler' with 'Move Thread'

* Fix linter

* Remove enterprise lock

* A couple more occurrences of wrangler strings, and one more enterprise lock

* Fix server tests

* Fix i18n

* Fix e2e linter

* Feature flag shouldn't be on by default

* Enable move threads feature in smoke tests (#25657)

* enable move threads feature
* add @prod tag

* Fix move_thread_from_public_channel e2e test

* Fix e2e style

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
2023-12-11 15:27:34 -05:00
Ben Schumacher
5b6b425cfc [MM-56061] Only render where field in model.AppError when it's present (#25648)
* Only render where field in model.AppError when it's present

* Remove trailing comma from permission error
2023-12-11 10:27:51 +01:00
Agniva De Sarker
a54f927e3d MM-56039: Skip flaky test TestUserStore/LocalCache+PostgreSQL/SearchNotInTeam/ (#25638)
https://mattermost.atlassian.net/browse/MM-56039

```release-note
NONE
```
2023-12-11 10:25:39 +01:00
Agniva De Sarker
88bd7b65f0 MM-55589: Throw warn logs for MySQL < 8 (#25637)
We just throw a warn log for now. Support will be completely
removed next ESR.

https://mattermost.atlassian.net/browse/MM-55589
```release-note
MySQL 5.7 is at EOL. We recommend all customers to upgrade to atleast 8.x. For now, we are logging a warning. From version 9.5 onwards, which is the next ESR, we will stop supporting 5.7 altogether.
```


Co-authored-by: Neil B <93996140+nab-77@users.noreply.github.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2023-12-11 09:21:18 +05:30
Harrison Healey
b1e745894b MM-55468 Ensure custom status emojis exist (#25501)
* MM-55468 Ensure custom status emojis exist

* Fix plugin API unit test

* Print underlying error as detailed error message

* Convert CustomStatusModal tests to React Testing Library and improve a11y

* Don't suggest custom statuses with non-existent emojis

* Silence test error by providing fake translation strings
2023-12-08 10:35:15 -05:00
Devin Binnie
109f4643c6 [MM-55017] Add API method to get users for Admin Reporting (#25499)
* Add store method to get reporting data

* Some store changes

* Added app layer

* Added API call, some miscellaneous fixes

* Fix lint

* Fix serialized check

* Add API docs

* Fix user store tests leaking users

* Fix test

* PR feedback

* Add filtering for role/team/activated user, filter out bot users

* Fix mock

* Fix test

* Oops

* Switch to using struct filter

* More PR feedback

* Fix gen

* Fix test

* Fix API docs

* Fix test

* Fix possible SQL injection, some query optimization

* Fix migrations

* Oops

* Add role to API

* Fix check

* Add Client4 API call for load testing

* Fix test

* Update server/channels/store/storetest/user_store.go

Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>

* PR feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2023-12-08 10:30:08 -05:00
Adam Warner
3fe68e73bf [MM-48860] / [GH-21863] Change regex to reduce false positive transforms on incoming webhook text (#21852)
* Change regex to reduce false positive transforms on incoming webhook text

Adds an additional condition to the 2nd capture group to ensure we don't match another `|` char

See https://github.com/mattermost/mattermost-server/issues/21800 for details

* Add test per suggested comment (switch Pi-hole URL out for Mattermost one 😉)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>

---------

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
Co-authored-by: Mattermost Build <build@mattermost.com>
Co-authored-by: Saturnino Abril <saturnino.abril@gmail.com>
2023-12-06 11:12:31 -08:00
Doug Lauder
8bf9e4c481 Prep for MS Teams plugin API (#25565)
* - columns added to ShareChannelRemotes: lastpostcreateat, lastpostupdateat
- SyncMsg and SyncResponse moved to `model` package
- field added to RemoteCluster struct: PluginID

* sync new posts before updated posts to ensure post order in MS Teams

* add plugid to remoteclusters table and store

* don't sync history by default
2023-12-04 13:10:20 -05:00
Ben Schumacher
b2ec1ff8ae [MM-55595] Use annotated logger in search layer (#25468) 2023-12-04 18:34:57 +01:00
Daniel Espino García
f6d41bcf5b Fix 55496 (#25585) 2023-12-01 10:50:57 +01:00
Devin Binnie
639181dcc1 [MM-55631] Remove extra call to Draft().Get() (#25563) 2023-11-30 10:45:32 -05:00
Daniel Espino García
2ff0fe343e [MM-45272] Fix MM-45272 (#24701)
* Fix MM-45272

* Properly handle permalinks

* Fix

* Fix tests

* Handle only not found case for team member

* Fix lint

* Use proper config value

* Separate permission in several statements

* Add tests

* Fix lint

* Revert changes on utils

* Address feedback and more fixes

* Address feedback

* Fix test

* Fix test and related bug

* Fix and reorder test

* Address feedback

* Address feedback

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-11-30 11:43:51 +01:00