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

2136 Коммитов

Автор SHA1 Сообщение Дата
Agniva De Sarker
cfcdce9ae7 Migrate post_store to sqlx (#19241)
* Migrate post_store to sqlx

There are several queries which should improve further
if re-written with squirrel. HW tickets will be opened
for those.

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/ctnryw9mga7fu9kc16xsap4phuw

```release-note
NONE
```

* Remove struct

```release-note
NONE
```

* fix tests

```release-note
NONE
```
2022-01-03 10:40:16 +05:30
Michel Engelen
c198ef6e16 adding a feature flag for inline post editing (#19210) 2021-12-21 08:59:52 +01:00
Ben Schumacher
34c4e543f9 [MM-39999] Increase key length in plugin KV store to 150 (#19002) 2021-12-20 13:13:50 +01:00
Ben Schumacher
052d99c362 Remove dead struct ManifestExecutables (#19122) 2021-12-09 09:22:43 +01:00
Christopher Speller
5ec78546e2 MM-38150 Adding playbooks permissions (#19096)
* Add playbooks related permissions.

* Add RolesGrantPermission to pluginapi

* Fixing scopes.

* New defaults.

* Fix defaults

* Fix tests.

* Fix migration.

* More test and migration fixes.

* Need to add everything to system admin too.

* Move to 63

* Feedback fixes.

* Fix system manager editing playbook permissions.
2021-12-07 09:43:33 -08:00
Claudio Costa
6d361db638 [MM-40485] Enable receiving binary websocket messages (#19128)
* Enable receiving binary websocket messages

* Improve error message

* Prefer anonymous declaration

* Simplify

* Improve test

* Use MessagePack to clone WebSocketRequest struct

* Use short form

* Fix test
2021-12-07 15:24:18 +01:00
Kyriakos Z
36c8d1d1a0 MM-36862: removes participant from thread (#18795)
* MM-36862: removes participant from thread

Removing a participant upon last reply deleted from thread didn't work
reliably, a suspect on this is the replica lag, since we are first
deleting the post and then counting non-deleted posts of the participant
to decide on whether to delete or not.

The findings that led to this conclusion is that the reply count gets
updated but the participant is not removed (participant removal depends
on the number of replies this participant has in the thread.)

This commit fixes that by removing first the participant and then
deleting the post.
So we delete the participant if they have 1 post in that thread, and
then we delete the post, so now they have no posts in the thread.

* Makes deleting posts transactional

This commit makes deleting a post transactional and also tries to fix
permanent deletion of posts.

Currently when we permanently delete all posts by a user we don't update
the threads reply count nor the participant's array. This commit tries
to fix that.

* Adds comments on deleting posts

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-12-06 12:01:04 +02:00
Carrie Warner (Mattermost)
243a066554 Merge pull request #19043 from mattermost/tos-tou
Updated Terms of Service to Terms of Use
2021-12-03 10:19:29 -05:00
Agniva De Sarker
34db2e92cc Remove reliable websockets configuration (#19040)
The feature is stable enough to be removed
as a config knob.

For backwards compatiblity with older mobile
clients, we keep sending the config param
as true for client config requests.

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4/7m95frqbk9o8zxin6xo9c7iusoh

```release-note
NONE
```
2021-12-03 20:29:57 +05:30
Pablo Andrés Vélez Vidal
8a62bfaa65 MM-38674 - AB test for first guided channel creation (#18885)
* MM-38674 - AB test for first guided channel creation

* set default value for the guided creation as false

Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
2021-12-02 14:42:08 +01:00
Pablo Andrés Vélez Vidal
c96bb583e7 MM-40222 - show gov references in license page when gov license (#19100)
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
2021-12-01 18:45:33 +01:00
Ben Cooke
27dacb82ce [MM-38239 & MM-39788] Recent files causing crash (#18942)
* wip

* adding tests for new endpoint

* tool updates

* new function for getting postsByIds

* fixing test

* adding limit of 1000 to post query

* fixing PR comments

* fixing permission logic

Co-authored-by: Collin <collineng@gmail.com>
Co-authored-by: Collin Eng <eng.engineereng@gmail.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
2021-11-26 11:51:32 -05:00
Carlos Tadeu Panato Junior
44d324a45f prepera db upgrade to 6.3 (#19086) 2021-11-26 16:51:25 +01:00
Carrie Warner (Mattermost)
d19204d584 Updated Terms of Service to Terms of Use 2021-11-24 08:48:01 -05:00
Claudio Costa
3dea98ea4b Implement deep copy method for model.WebSocketEvent (#18977) 2021-11-22 09:54:19 +01:00
Ashish Bhate
0da249c651 [MM-37013] Async job to fix CRT channel unreads (#18340)
Summary
The addition of the TotalMsgCountRoot and MsgCountRoot columns to support CRT caused several issues with previously read threads and channels being marked as unread. Previously we attempted to fix this purely in a SQL migration [MM-35345][MM-35494] fixes for incorrect mentions and unreads for threads and channels #17803 but that turned out to be too heavy and it was decided to break up some of the fixes into async jobs.
This PR implements an async job to mark channels as read if there are no user posts since the last time the user viewed the channel. 

Ticket Link
https://mattermost.atlassian.net/browse/MM-37013
2021-11-18 15:31:18 +05:30
Agniva De Sarker
b7a7d8e7b6 MM-39612: Make acquiring and removing connections atomic (#18982)
* MM-39612: Make acquiring and removing connections atomic

The reconnect phase of a websocket was split into two parts:
one where we check if a connection with a given connectionID
exists or not. And second, where we remove that connection
and insert the new connection again in the index.

This would lead to a race where it would be possible
for 2 concurrent requests for the same connectionID to go through
which would lead to separate goroutines working on the same dead queue.

We simplify this by removing the connection from the index
in the check connection stage itself. And then just add that
during register phase.

And to distinguish between a fresh and an old connection, we add
a new field called reuseCount.

While here, we also cleanup some old comments and add more
in some places.

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

```release-note
NONE
```

* remove unused method

```release-note
NONE
```

* race test

```release-note
NONE
```
2021-11-16 19:43:43 +05:30
Allan Guwatudde
0ee2a3ca35 [MM-39060] - A/B Test: Reminder to Join Workspace email (#18894)
* [MM-39060] - A/B Test: Reminder to Join Workspace email

* Fix error and add error handling

* feedback impl

* run make i18n-extract

* improvements

* make i18n-extract

* setup ability to do telemetry on reminder invite emails

* improvement

* add telemetry

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-11-15 18:42:15 +03:00
Allan Guwatudde
21a61813e8 [MM-39504] - Remove Prewritten Messages Feature Flag (#18968) 2021-11-15 09:35:10 +03:00
Anurag Shivarathri
65c670a4c9 MM-36687 CRT push notifications (#18347)
* CRT changes

* Lint fix

* Moved postId check

* Moved postId check

* Lint fix

* Misc

* Added test case for badge count while clearing notifications

* Fixed count when CRT is on and added isCRTEnabled, teamId to isIdLoaded notifications

* test fix

* isCRTEnabledForUser capitalised

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-11-15 10:41:47 +05:30
Devin Binnie
929caaff3d [MM-39374] Remove DesktopLatestVersion and DesktopMinVersion (#18979) 2021-11-12 10:37:43 -05:00
Nathaniel Allred
a7d9b83968 Mm 38799 invite to team (#18987)
* Add in-screen invitation modal invite to team feature flag
2021-11-12 09:20:15 -06:00
Sharath Huddar
27559c1c7b GH-18288: Allow configuring unsafe-eval and unsafe-inline (#18801)
* GH-18288: Allow configuring unsafe-eval and unsafe-inline

* Add developer flags to telemetry

* wip

* wip

* Refactor based on review

* Refactor based on review

* fix expected vs. actual in assert.Equal

* Add unit tests, rework to check only supported flags.

* Update model/config.go

Co-authored-by: Jesse Hallam <jesse@thehallams.ca>

* Fix failing tests

* Refactor based on review

* Refactor based on review

* Refactor based on review

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Co-authored-by: Jesse Hallam <jesse@thehallams.ca>
2021-11-12 05:41:11 +08:00
Michael Kochell
ba1b279c5f [MM-39820] Add AppBarEnabled feature flag (#18967)
Automatic Merge
2021-11-10 19:10:14 +01:00
Carlos Tadeu Panato Junior
19de373498 update client function to match the new format and fix bad merge (#18978) 2021-11-10 12:38:02 -05:00
Carlos Tadeu Panato Junior
bb5a74a42b [MM-34076] Add Plugin API User custom status (#17435)
* add missing client for custom user status

* add custom user status plugin api

* update based on feedback review

* add GetCustomStatus

* update interfaces
2021-11-10 11:11:20 -05:00
Berke Kalkan
e70c5a605a MM-32396 Create endpoint for listing all the roles (#16988)
* Create an endpoint for listing roles

* Add function to client model

* Create tests for listing roles endpoint

* Apply code review suggestions

* Restore GetAllRoles app method

* Use AppContext instead of App

* Minor fix

* Refactor according to new changes

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-11-08 16:38:41 +03:00
Agniva De Sarker
24248dc764 Add JobSettings.CleanupJobsThresholdDays to telemetry (#18936)
* Add JobSettings.CleanupJobsThresholdDays to telemetry

```release-note
NONE
```

* Moved telemetry to more specific fields

```release-note
NONE
```

* Add missing space

```release-note
NONE
```
2021-11-08 11:45:59 +05:30
Allan Guwatudde
7287da6391 [MM-39503] - Remove DownloadApps Feature Flag (#18902) 2021-11-04 16:28:46 +03:00
Carlos Tadeu Panato Junior
69eb0ca773 db: upgrade db to 6.0 and prepare for 6.1 (#18923)
* db: upgrade db to 6.1

* db: prepare db upgrade to 6.2

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-11-03 16:16:33 +01:00
Claudio Costa
13c0ba6e8a Strip arguments from logged command (#18862) 2021-11-03 08:30:33 +01:00
Claudio Costa
f621989c58 [MM-39597] Implement ConfigDiffs.Sanitize() (#18855)
* Implement ConfigDiffs.Sanitize()

* Remove possibly sensitive info from logs
2021-10-28 14:07:35 +02:00
Pablo Andrés Vélez Vidal
841155db3e MM-39059 - AB test for the add members channel (#18832)
Co-authored-by: Pablo Velez Vidal <pablo.velez@mattermost.com>
2021-10-26 16:06:50 +02:00
Agniva De Sarker
e24f22745e [MM-18946] [MM-26721] [MM-6842] Cross team search+private channel autocomplete (#18468)
* Show private channels in autocomplete

This is supported in all Engines:
MySQL, Postgres, Bleve, Elasticsearch.

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

```release-note
Private channels will now appear in channel autocomplete.
If you are using Bleve or ElasticSearch, you will have to reindex
the channels again to populate them with the new attributes.
```

A large chunk of this work has been based on the earlier
effort at https://github.com/mattermost/mattermost-server/pull/17804.

Full credit goes to https://github.com/arvinDarmawan.

* Add comment

```release-note
NONE
```

* Adding more tests

```release-note
NONE
```

* fix more tests

```release-note
NONE
```

* tmp

```release-note
NONE
```

* more fixes

```release-note
NONE
```

* add tests

```release-note
NONE
```

* Add review comments from previous PR

```release-note
NONE
```

* Add API to return all channels from all team

```release-note
NONE
```

* Added support for bleve and ES

```release-note
NONE
```

* Streaming response for GetAllChannels

```release-note
NONE
```

* Fix tests

```release-note
NONE
```

* Trigger CI
```release-note
NONE
```

* fix tests

```release-note
NONE
```

* Addressing review comments

```release-note
NONE
```

* Fix lint

```release-note
NONE
```

* Removing flaky test

```release-note
NONE
```

* Address comments

```release-note
NONE
```

* Trigger CI
```release-note
NONE
```

* Added /users/<userid>/channel_members endpoint

```release-note
NONE
```

* Minor edit

```release-note
NONE
```

* Improve embedding

```release-note
NONE
```

* Fix lint error

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-26 11:30:59 +05:30
Scott Bishel
a6cca93ba3 Add Feature flag for Boards (#18798)
* add BoardsFeatureFlag

* linter fix
2021-10-22 08:27:30 -06:00
Claudio Costa
deac72d2be Implement auditUserPatch (#18794) 2021-10-21 20:29:17 +02:00
Allan Guwatudde
246a0c297e [MM-39053] - A/B test for default notification settings (#18655)
* [MM-39053] - A/B test for default notification settings

* fix tests

* first name notifications on

* update

* Fix bad merge alignment

Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
2021-10-21 14:00:25 +03:00
Nathaniel Allred
176f8d5511 set default feature flag values (#18784) 2021-10-20 14:23:47 -05:00
Nathaniel Allred
3365f56584 support auto tour ab test (#18695) 2021-10-20 12:48:08 -05:00
Mattermod
d4e08e26fd Update minor version to 6.1.0 (#18658)
Co-authored-by: Mmbot <mmbot@mattermost>
2021-10-20 16:29:15 +02:00
Claudio Costa
01f2b2089b Explicitly handle values in audit type conversion (#18768) 2021-10-20 14:52:48 +02:00
Maria A Nunez
c75058d4bc Added sales-serve billing scheme (#18697) 2021-10-19 16:04:24 -04:00
Agniva De Sarker
acd08f0a48 Fix migration scripts (#18756)
* Fix migration scripts

Set the DB schema version in DB prior to running migration

https://community-daily.mattermost.com/boards/workspace/zyoahc9uapdn3xdptac6jb69ic/285b80a3-257d-41f6-8cf4-ed80ca9d92e5/495cdb4d-c13a-4992-8eb9-80cfee2819a4?c=c2525dbb-23eb-4fe7-8fb4-e9a5f503dc8c

```release-note
NONE
```

* Revert schema to 6.0.0 and update CI scripts

* Fix typo

* Add missing default

* Fix extra comma

Co-authored-by: Claudio Costa <cstcld91@gmail.com>
2021-10-19 19:56:09 +05:30
Shobhit Gupta
e12e0df447 Migrate from gorp to sqlx in store/sqlstore/job_store.go (#18518) 2021-10-19 19:29:24 +05:30
Jesús Espino
63ece5a29b Adding the feature flag to enable/disable calls in the mobile app (#18689) 2021-10-15 19:13:28 +02:00
Agniva De Sarker
99e6039472 Add functionality to cleanup old jobs (#18646)
* Add functionality to cleanup old jobs

Historically, we never cleaned up old jobs from the DB
leading to them being accumulated forever.

This PR introduces functionality to cleanup old jobs
older than a defined threshold.

The functionality is set to false by default and has
to be enabled for it to work.

```release-note
2 new config settings were added.

JobSettings.CleanupOldJobs: This indicates whether to clean up old jobs
from the DB or not. Default is false.

JobSettings.CleanupJobsThresholdHours: This defines the time gap in hours beyond
which older jobs will be removed. This has no effect if the above config
setting is set to false. Default is -1
```

* fix copy pasta

```release-note
NONE
```

* address review comments

```release-note
NONE
```

* Fix lint

```release-note
NONE
```

* Use single config option for everything

```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-15 11:03:54 +05:30
darkLord19
98284a79eb remove timedDND feature flag (#18346) 2021-10-14 11:54:09 -04:00
Kyriakos Z
4b85f9ee6a MM-36743: adds last_root_post_at in channels table (#18366)
* MM-36743: adds last_root_post_at in channels table

Channel recency for CRT users should not count replies,
this commit solves that issue by adding a new column to the channels
table: LastRootPostAt.
With that new info CRT users can have recent channels to work as
expected.

* Adds the 'LastRootPostAt' to the SQL scripts

* Fixes tests

* Adds LastRootPostAt migration to v6.1

* Fixes index

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-13 15:20:44 -04:00
Hossein
6521b0dfe3 Unfurl Focalboard Server PR (#18271)
* Allow Embeds editing without editing

* Add focalboard to embed after it being in props

* Fix tests

* change to boards

* remove extra gunk

* Fix tests

* Add Feature Flag

* update boardsunfurl

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2021-10-13 10:51:27 -04:00
Carlos Tadeu Panato Junior
3b81d9f83e db: add db upgrade for 5.39 and upgrade to 6 (#18645) 2021-10-12 09:37:56 +02:00