This originated from https://github.com/mattermost/mattermost/issues/15249.
However, the original idea was discarded https://github.com/mattermost/mattermost/issues/15249#issuecomment-709713065
as being too complicated to implement. Then I had another
idea to implement it just for session objects.
My thinking was that since every single request allocates a new
session struct, it would be good to use a sync.Pool for that.
However, 4 years later, now we know that the primary bottleneck
in app performance comes from websocket event marshalling.
Therefore, while it would be good to do this, it is difficult
to do it correctly (as shown by the numerous racy tests).
Hence, reverting this.
```release-note
NONE
```
* Revert "MM-54502 - Update regex to force first character to be alpha (#24675)"
This reverts commit 08ed72f060.
* update tests for reverted PR
* Revert "update tests for reverted PR"
This reverts commit c1cf5495fa129008e44a8fcdc0ee34762b33dd34.
* Revert "Revert "MM-54502 - Update regex to force first character to be alpha (#24675)""
This reverts commit 6920b979c8dba86a837bafff7c057dc609c6aa58.
* only revert important parts, not tests
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* add tests
* pass userID to the function instead of the user object.
* remove concurrent login simulation
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* 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
* Excludes remote channels from channel search
This is done through a new body parameter in the SearchAllChannels
endpoint that allows to search for local only channels, which are
either channels that are shared but marked as homed locally, or
channels that are not shared at all.
* fix lint
* Fix tests
---------
Co-authored-by: Caleb Roseland <caleb@calebroseland.com>
Support for RemoteClusters without a default team id is in place for
old servers that created those connections before v10.1. This change
forbids the creation of new RemoteClusters without providing this
field, and will be removed when manual invites are implemented.
Co-authored-by: Caleb Roseland <caleb@calebroseland.com>
* additional validation for channelbookmark
* add fixes for webapp
* only set permissions correct for type
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
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
```