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

2231 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
c6dcf460b2 MM-43232: Racy test TestWebsocketRace (#19969)
We wait until the loop has exited to finish the test

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

```release-note
NONE
```
2022-04-14 13:25:19 +05:30
Agniva De Sarker
6eb83812e1 Propagate the parse error for URLs (#19972)
During config validation, we would omit the actual error.
This makes debugging difficult.

```release-note
NONE
```
2022-04-13 22:20:46 +05:30
Mattermod
3cd3c7dc9a Update minor version to 6.7.0 (#19973)
Automatic Merge
2022-04-13 18:57:05 +03:00
Agniva De Sarker
c0b2aae84e MM-43340: Fix racy test TestGraphQLChannelMembers (#19968)
We take a shallow copy of the team pointer before
we pass that to the other functions.

This is because the resolvers run in separate
goroutines.

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

```release-note
NONE
```
2022-04-13 18:50:33 +05:30
Pablo Andrés Vélez Vidal
6881b12af9 MM-39565 - remove top option ab testing (#19966)
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
2022-04-12 18:44:03 -05:00
Kevin Sicong Jiang
5cb31a114a MM-41909: Allow 1 char channel name (#19845)
* [ MM-41909 ] Allow 1 character channel names

Change minimal length to 1

* [ MM-41909 ] Fix localization string

* [ MM-41909 ] Modify condition to allow 1 char channel name

* [ MM-41909 ] fix formatting

* [MM-41909] Linting fix

* [MM-41909] Fix regex

* [MM-41909] Localization update

* [MM-41909] Attempt to fix test

Co-authored-by: Kevin Jiang <>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-12 11:17:15 -04:00
Pablo Andrés Vélez Vidal
4b354685e9 MM-39058 - invite people to join team and channels (#19849)
* MM-39058-invite-to-team-from-add-channel

* fix tests by validating the memberInvite is not nil

* fix i18n texts

* fix lint problem

* fix translation lines

* fix the data structure

* modify api4-team_local file to match with the expected structure

* fix unit tests, fix translation tests

* remove go routine cause not necesary

* add unit test for invite to team and channel

* remove unnecessary validation

* allow both data structures, simple string array and object with memberInvite struct

* fix texts

* fix linter

* fix problems with graceful invites workflow

* handle error while parsing body

* fix unit tests

* take the address just once

* rename channels to channelIds

* fix unit tests

* add tests and fix local channels invite support

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
2022-04-08 12:20:44 -05:00
Mylon Suren
6da1d90c4a [MM-38615] Permalink previews for DMs/GMs (#19765) 2022-04-07 17:32:18 -04:00
mkraft
ce2646de3e Disambiguates some units. (#19875)
* Disambiguates some units.

* Updates DB attribute.

* Updates some more error-prone units.

* Updates some tests with legible constants.

* Updates query for MySQL case sensitivity.

* Fixes more casing issues.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-07 13:58:40 -04:00
Michael Kochell
7631035165 Prepackage Apps plugin and enable Apps feature flag by default (#19870)
* prepackage with apps 0.7.0

* fix config comparison test

* update apps plugin version to 1.0.0

* remove irrelevant whitespace change

* change apps plugin version to 1.0.1

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-06 21:32:56 -04:00
Agniva De Sarker
2e027ae927 Optimize marshalling for jsonb types (#19898)
We check for the presence of binary_parameters
in the DSN and add the 0x01 byte accordingly.

This helps us avoid casting to string
and efficiently use the database.

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-06 15:01:32 +05:30
Ashish Bhate
9521797b15 MM-40148: threadsOnly query param for user threads (#19833)
* MM-40148: threadsOnly query param for user threads

Currently we always calculate counts when fetching user threads.
Those counts include total, unread replies, and unread mentions,
and are potentially expensive to calculate.

This commit adds a new query param 'threadsOnly' which won't calculate
any counts and just return threads.

Co-authored-by: koox00 <3829551+koox00@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-04-04 17:50:13 +05:30
Allan Guwatudde
c17e210dd0 [MM-40962-2] - Fix unnecessary logging in license expiration check (#19826)
* [MM-40962-2] - Fix unnecessary logging in license expiration check

* skip check for TE

* document

* feedback impl-1

* fix logic

* remove saving of renewal token

* fix lint

* remove commented code

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-31 18:25:46 +03:00
Allan Guwatudde
fa56ee9d9a [MM-42713] - Remove cloud user limit restrictions (#19835)
* [MM-42713] - Remove cloud user limit restrictions

* remove unused code

* fix translations

* feedback impl-1

* enterprise code clean up

* feedback impl-2

* fix mocks

* fix translations

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-31 18:24:38 +03:00
Agniva De Sarker
f8a3119426 MM-41260: Revamp ES/Bleve batching logic (#19841)
The older method used to reply completely on timestamps
to take batches of items in a timestamp range and then
just incrementing the timestamp. This led to handling
edge-cases such as more items than the batch count, all
having the same timestamp.

Additionally, relying on timestamp as the page cursor
meant that indexing was not very efficient if you had
several items spread out across large spans of time.

To get away from all of that we use a proper cursor-based
approach consisting of createAt+Id. With this, we move
completely to a constant page size where we can fetch
a given number of objects irrespective of when they
were created. This makes indexing much more faster and
efficient.

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

```release-note
Elasticsearch and Bleve indexing have been revamped to be much
more efficient and faster. The config parameter BulkIndexingTimeWindowSeconds
for both elasticsearch and bleve have been removed.
A new config parameter called BatchSize has been introduced instead.
This parameter controls the number of objects that
can be indexed in a single batch. This makes things
more efficient and maintains a constant workload.
```
2022-03-31 10:46:01 +05:30
Julian Mondragón
baf9f69c27 MM-41407_Remove FF for MM-39053 Default Notifications (#19851) 2022-03-30 12:07:03 -05:00
Allan Guwatudde
82c8bd33ed [MM-42703] - Add configuration setting to disable Inactive Server email notification (#19831)
* [MM-42703] - Add configuration setting to disable Inactive Server email notification

* remove log

* add config to telemetry

* fix lint
2022-03-30 11:31:46 +03:00
Mmbot
2aa06529c5 Update minor version to 6.6.0 2022-03-29 17:59:47 +03:00
Ben Cooke
aa696ba36d [MM-42627] Feature flag for insights (#19839)
* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* feature flag for insights

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
2022-03-28 18:30:05 -04:00
Julien Tant
0babc01749 [MM-41998] Channel Info RHS: display number of files for a channel (#19822)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-25 13:28:14 -07:00
Ibrahim Serdar Acikgoz
3e8b81c0c7 graphql: Add channel stats under channel (#19804)
* graphql: Add channel stats under channel

* add permission check
2022-03-25 11:59:57 +03:00
Agniva De Sarker
c1f3827801 MM-38164: Paginate the GetPostThread API (#19485)
We implement a cursor based pagination model
to page through the posts in a given thread.

The cursor is a combination of the post.CreateAt+
post.Id to differentiate multiple posts in a given
timestamp.

Some additional parameters like direction, fromPost,
fromCreateAt and perPage were introduced to implement
this.

```release-note
NONE
```
2022-03-24 12:51:41 +05:30
Ashish Bhate
2385bbdd50 MM-42535: Set ThreadAutoFollow to true by default (#19797)
Summary
A number of performance improvements shipped in v6.5 to support CRT with the ThreadAutoFollow bookkeeping enabled but the frontend features disabled. To prepare for a later enabling of the frontend features by default, we want to encourage customers to re-enable ThreadAutoFollow, and plan to enable this by default in v6.6.

Ticket Link
https://mattermost.atlassian.net/browse/MM-42535
2022-03-23 21:00:53 +05:30
Carrie Warner (Mattermost)
dcd66d2146 MM-41988 Updated links to legacy domain about.mm.com (#19552)
* Updated links to legacy domain about.mm.com

* Legacy link updates

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* Reverting - only need to change en.json

* about.mm.com URL updates

* mattermost.org URL updates

* forum.mm.org URL update

* Update .github/ISSUE_TEMPLATE.md

* Update .github/ISSUE_TEMPLATE.md

* Un-deleted language files

* Update README.md

* Update tests/test-config.json

* fix some test due to url updating (#19787)

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Harrison Healey <harrisonmhealey@gmail.com>
Co-authored-by: Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>
2022-03-16 19:47:57 +08:00
Ben Schumacher
7710a2fe37 [MM-40735] Add MattermostAppID to OAuth app (#19214) 2022-03-15 18:00:27 +01:00
Ibrahim Serdar Acikgoz
b03d87af40 [MM-41576] Add schema version to the client configuration (#19757)
* revamp db version and add applied migrations endpoint

* replace old schema version with new

* add db version subcommand

* add to local api

* reflect review comments

* log errors

* remove setting the version from model.CurrentVersion

* fix a test

* use different field for schema version

* add build hash and current version to the support packet

* add tests

* update test to use new assets
2022-03-15 16:39:23 +03:00
Michel Engelen
f4f8dcc88b remove feature flag for inline post editing (#19761) 2022-03-14 13:57:22 +01:00
Michel Engelen
77e779bf4f remove feature flag for global header (#19763) 2022-03-14 13:46:47 +01:00
Michel Engelen
16a1d8fe72 completely remove feature flag for "workspace optimization dashboard" (#19754) 2022-03-14 13:45:21 +01:00
Allan Guwatudde
d543db6186 [MM-41573] - Remove FF for MM-39060 Resend Invite Interval (#19652)
* [MM-41573] - Remove FF for MM-39060 Resend Invite Interval

* feedback impl
2022-03-09 17:57:25 +03:00
Jesse Hallam
a2a78577e9 Revert "[MM-41576] Revamp database schema version (#19586)" (#19746)
* Revert "[MM-41576] Revamp database schema version (#19586)"

This reverts commit 645fee3fe3.

* Revert "MM-42049 - license endpoint not working (#19686)"

This reverts commit 4fe89e5847.
2022-03-08 16:28:28 -04:00
Michel Engelen
f8cd26cb6b set default value for workspace optimization dashboard feature flag to true (#19734)
Automatic Merge
2022-03-08 18:44:20 +02:00
Ibrahim Serdar Acikgoz
645fee3fe3 [MM-41576] Revamp database schema version (#19586)
* revamp db version and add applied migrations endpoint

* replace old schema version with new

* add db version subcommand

* add to local api

* reflect review comments

* log errors

* remove setting the version from model.CurrentVersion

* fix a test
2022-03-08 18:13:37 +03:00
mkraft
21f1d2aabc MM-42201: Enforce group is not the same as username. (#19660)
* MM-42201: Enforce group is not the same as username.

* MM-42201: Adjust test for change to translation id.
2022-03-08 09:14:22 -05:00
Agniva De Sarker
cf6aa85d28 MM-42268: We add more fields to Channel and Team (#19675)
Also added sessions as part of the user object

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

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-07 20:14:53 +05:30
Maria A Nunez
3be329b5e8 Defaulted use case onboarding feature flag to true (#19690)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-04 18:49:40 -05:00
Julien Tant
b70338071f [MM-41579] Remove FF guided channel creation (#19673)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-04 16:40:04 -07:00
Shaz Amjad
1b41957239 API includes sort_order, and WebSocket includes data (#19157)
* API includes sort_order, and WebSocket includes data

* Adds sort_order API test

* MM-40470: Tests that new WS payload is sent after categories are updated via API.

* Update api4/channel_category_test.go

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

Co-authored-by: Martin Kraft <martin@upspin.org>
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
2022-03-04 13:25:15 +01:00
Christopher Speller
4ecd071275 Add new playbooks permissions. (#19661) 2022-03-03 08:10:41 -08:00
Julien Tant
dd100a3a69 [MM-41785] Show error in invitation popin when email can't be send (#19617)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-02 14:26:57 -07:00
Daniel Espino García
32e3c2f0b8 [Gekidou] Add push notification check to ping (#19610)
* Add push notification check to ping

* Add test type and missing details

* Address feedback

* Fix function name

* Address feedback

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-02 12:15:58 +01:00
Jesse Hallam
6757edc4e2 MM-41349: CRT, fix LastUpdated semantics (#19523)
* deadcode: remove UpdateChannelLastViewedAt

* deadcode: remove ThreadStore.(Save(Multiple)|Update|Delete)

* deadcode: followThead in App.MarkChannelAsUnreadFromPost

* document ThreadMembership, Thread structs

* maintain LastUpdated consistently

Whenever we touch a `ThreadMembership` record, we should be setting `LastUpdated` to the current timestamp. The mobile client relies on this to detect changes to these records.

* simplify: never updateThreads from `App.MarkChannelAsUnreadFromPost`

Change all invocations of `ChannelStore.UpdateLastViewedAtPost` from `App.MarkChannelAsUnreadFromPost` to pass `updateThreads` as `false`. When `ChannelStore.UpdateLastViewedAtPost` was invoked with `updateThreads` as `true`, it would in turn call `ThreadStore.UpdateUnreadsByChannel` but pass `updateViewedTimestamp` as `false`. This effectively updated the `LastUpdated` field of the corresponding thread memberships but never touched any of the actual data (such as `LastViewed`).

The overall CRT feature continued to work, because `App.MarkChannelAsUnreadFromPost` directly updates the relevant thread memberships via `ThreadStore.MaintainMembership`.

* deadcode: updateThreads in ChannelStore.UpdateLastViewedAtPost

* simplify: never updateThreads from App.SendNotifications

Change all invocations of `ChannelStore.IncrementMentionCount` from
`App.SendNotifications` to pass `updateThreads` as `false`. When `ChannelStore.IncrementMentionCount` was invoked with `updateThreads` as `true`, it would in turn call `ThreadStore.UpdateUnreadsByChannel` but pass `updateViewedTimestamp` as `false`. This effectively updated the `LastUpdated` field of the corresponding thread memberships but never touched any of the actual data (such as `UnreadMentions`).

The overall CRT feature continued to work, because `App.SendNotifications` directly updates the relevant thread memberships mention counts via `ThreadStore.MaintainMembership`.

* deadcode: updateThreads in ChannelStore.IncrementMentionCount

* fix & rename ThreadStore.UpdateUnreadsByChannel

Rename `ThreadStore.UpdateUnreadsByChannel` to `ThreadStore.UpdateLastViewedByThreadIds`, making it unconditionally set the `LastViewed` for the given threads (as well as `LastUpdated`).

All previous invocations of this method that passed `updateViewedTimestamp` have been previously removed.

* unrelated gofmt -w -s changes to satisfy linter

* always set LastUpdated to model.GetMillis()

* deadcode: ThreadStore.SaveMembership

* fix TestMarkUnreadWithThreads

* GetMasterX
2022-02-28 16:24:34 -04:00
Josh Soref
5d85417a8b spelling: strings (#19542)
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-02-28 15:01:00 +05:30
Nathaniel Allred
32fd4d7f16 fix string constants (#19642) 2022-02-25 13:56:40 -06:00
Julien Tant
53919bd332 [MM-41671] Support Email Position+Validation (#19590) 2022-02-23 08:04:29 -07:00
Allan Guwatudde
8d6d1c51c2 [MM-40917] - Inactive Server Email Notification (#19374)
* [MM-40917] - Inactive Server Email Notification

* add email template

* make store layers

* add some store tests

* fix translations

* fix logic

* improve

* fix lint

* feedback-impl

* fix wrong text

* optimize queries

* move feature flag check

* feedback impl-1

* add line

* feedback impl

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-02-22 20:41:58 +03:00
Claudio Costa
09eb6fb4d7 Allow sending intra cluster WS events reliably (#19594) 2022-02-22 13:43:38 +01:00
Julien Tant
d4378a6b42 [MM-41668] Remove "add support email" admin advisor notifications (#19567)
Automatic Merge
2022-02-19 00:04:18 +02:00
Agniva De Sarker
ff9e765eaa Include binary parameters in default data source (#19570)
This is to make the default more consistent with
what we have in our cloud production. It should
help in surfacing bugs more quickly.

```release-note
NONE
```
2022-02-18 19:51:57 +05:30
mkraft
7fa6b321ae Custom groups (#18839)
* WIP

* adding initial creategroup endpoint

* fetching by group source

* fixing startup error

* updating create endpoint to take an array of user_ids, this will allow us to create the group with one request

* adding delete group endpoint and appropriate test

* adding source param for getGroups

* adding add members and delete members endpoints

* locking down crud endpoints to only be allowed for custom groups

* user search stuff

* allowing remoteid be null by changing field to pointer

* code cleanup and store level tests

* adding new tests and removing unused endpoint

* resolving conflicts

* Adds authz check for group.

* Adds authz checks to groups APIs.

* Updated create group authz tests.

* Updates delete group tests.

* Tests create group.

* Adds some tests and validations.

* adding new parameter so I can get users not in a group

* Fixed all lint warnings.

* Fix type.

* fixing search users not in group

* Fixes some lint errors.

* Moves entry in JSON array.

* Fixed SQL query.

* Fixes permission migration test.

* Fixes migration test.

* Fixes some group store tests.

* Fix test.

* Fix test.

* Revert lint change.

* Migrated CreateWithUserIds to sqlx.

* Adds tests for GetMember; migrates implementation to sqlx.

* Tests GetNonMemberUsersPage and hanles wrong group id.

* Fixes test.

* Switches GetMaster to GetMasterX.

* Switches GetReplica to GetReplicaX.

* Fixes logic.

* Fixes shadow declaration.

* Adds include_member_count to get group API endpoint.

* Adds filter_has_member param to getGroups.

* Fixes.

* Removes array of group sources.

* fixing error

* Testing reverting CreateWithUserIds back to gorp.

* Added websocket event for CreateGroupWithUserIds.

* Changed a few response status codes. Switched to correct permission.

* Added member count to ws payload for group when updating or creating.

* Adds feature flag checks for custom groups.

* Added middleware function to require license. Added config to disable custom groups.

* Change for function signature change of executePossiblyEmptyQuery.

* Lint fixes.

* Adds telemetry none comment.

* Adds translations.

* Migrated to sqlx.

* Temp. removal of translation.

* Fixed typo.

* Added an intermediary model to query with a field that is now ignored by sqlx on read queries.

* Re-used existing store struct.

* Inludes member count.

* Fix for merge error.'

* Require license for group endpoints.

* Updates translations.

* Fix shadow declaration.

* Renames permissions. Switches to new method to retrieve remoteid.

* Added WS events for upsert and delete member(s).

* Added new store error type ErrUniqueConstraint.

* Added EnableCustonGroups to the client config.

* Sanitized some user records.

* Added parameter to include_total_count for listing groups.

* Added translations.

* adding deleteAt field to getByUsers query

* Revert sanitize.

* Added uniqueness constraint error to UpdateGroup.

* Removed the FutureFeatures flag so that the feature is not enabled on old Enterprise licenses.

* Renamed function.

* Updates authz check for user search related to groups.

* Removed debug statement.

* Removed unused app method.

* Added telemetry for enable_custom_groups.

* Returns early from nil license.

* Updates test.

* Returned early to avoid nesting in (*SqlGroupStore).checkUserExist. Switched to reading from replica in (*SqlGroupStore).GetMember. Handled JSON marshal error in (*Client4).UpsertGroupMembers

* Switched to SanitizeProfile.

* Switched to model.NewInt.

* Switched from status NotImplemented to Forbidden for missing license.

* Removed deactivated users from 'exists' set.

* Revert gotool update.

* Ignored lint error that I think is invalid.

* Added the approprate access tag for disabling custom groups.

* Revert change to response status.

* Fixed refactor mistake.

* Limited the group member WS events to individual users.

* Removed WS event of deleted groups.

* Updated license check for searchUsers endpoint.

* Switched from license feature to license sku.

* Update app/group.go

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

* Update app/group.go

Co-authored-by: Claudio Costa <cstcld91@gmail.com>

* Remove linter ignore comment.

* Added function to create sku-specific license.

* Fixed typo. Removed comment.

* Fixed for wrong type.

* Added missing param to client. Removed unnecessary props setting. Added test for retrieving groups by source.

* Updated some tests now that we're validating group membership not created for deactivated user.

* Fix for groups endpoint returning all group types by default.

* Changes constant names. Adds migration for all users to manage custom group members.

* Removes requirement for manage_system permission to filter user search by group.

* Added migration mock.

* Removes default permissions from custom_group_user role.

* Fixes migration.

* Fixes emoji migration test.

* fixing issue with member counts

* fixing search issue for deleted members

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>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.fritz.box>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>
2022-02-17 12:34:39 -05:00