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

2156 Коммитов

Автор SHA1 Сообщение Дата
Kyriakos Z
8f35243604 Fixes editing and pinning a post (#19425)
PR https://github.com/mattermost/mattermost-server/pull/19404 fixed the
replies on posts by casting StringArray to a string.

This PR fixes editing and pinning a post by casting StringArray, and
StringInterface to a string as well.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-27 14:47:41 +02:00
Agniva De Sarker
54938694b2 MM-41209: Fix flaky test CreateRecurringTaskFromNextIntervalTime (#19416)
We were noting down the time of execution of a function and
expected that to match with the exact interval that we set.

However, sometimes in very busy CI environments, the goroutine
does not get a chance to be scheduled at the right time for
the interval to match exactly. Sometimes, we see a delay of
1 second.

To account for this, we increase the interval to 3 seconds,
and consider a 1 second buffer for this. If we see lags of
more than a second, then this test becomes useless and we
would need to remove it entirely.

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

```release-note
NONE
```
2022-01-26 15:28:40 +05:30
Kyriakos Z
513a4669cc MM-41066: fixes replies when binary_parameters=yes (#19404)
* MM-41066: fixes replies when binary_parameters=yes

Migrating post_store from gorp to sqlx breaks replies on threads.
Why? Participants is a jsonb field and when binary_parameters is set to
'yes' it is failing to insert because it needs the version (1) to be
prepended to the bytes array ([]byte{0x01}).

The easiest fix on this is to cast to a string when inserting.
There is a drawback though, non utf8 characters would be replaced by the
question mark icon �.

This commit does exactly that, casts StringArray to a string.

* Adds a comment

* Removes unnecessary conversion

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-26 11:36:33 +02:00
Kirill Krotov
e2e049e05e [MM-39633] migrate team store to sqlx (#19207)
```release-note
NONE
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
2022-01-25 23:03:47 +05:30
Nathaniel Allred
3172adfce9 Mm 39663 (#19340)
* Add CurrentProductName to invoice
* make quantity a float
2022-01-24 15:43:42 -06:00
Lev
a0e870bed2 Restored ToJSON encoding (sans Integration) for Post APIs (#19279)
* Restored ToJSON encoding sans Integration for Post APIs

* PR feedback + GetPost test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-21 08:25:33 -08:00
Scott Bishel
956e21cfa2 Boards data retention (#19262)
* add Boards to DataRetention, add hook for data retention

* remove replaces

* update hook to remove parameter

* add boards data retention to telemetry

* fix unit test

* update test, update hooks

* update RunDataRetention server version

* put behind a feature flag

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-20 17:46:03 -07:00
Josh Soref
294bd44971 [GH-19267] Spelling comments (#19268)
* spelling: comments

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-20 10:07:27 +05:30
Martin Kraft
c02c3f7f97 MM-40686: Added feature flag for group member dn lookup. (#19289)
* MM-40686: Added feature flag for group member dn lookup.

* MM-40686: Changes feature flag name.
2022-01-19 09:19:23 -05:00
Scott Bishel
5e147dd150 remove BoardsUnfurl feature flag (#19283) 2022-01-17 10:11:01 -07:00
Agniva De Sarker
b37c07ec41 Migrate channel_store to sqlx (#19247)
* Migrate channel_store to sqlx

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

```release-note
NONE
```
2022-01-14 10:43:54 +05:30
Ibrahim Serdar Acikgoz
f829dba615 Update morph dependency (#19308)
* Update morph dependency to use a newer version

* remove timeout check for migrations statements

* store/sqlstore: reset timeout for mysql while creating db for migrations

* update morph to v0.2.1
2022-01-12 17:24:29 +03:00
Ashish Bhate
a55bd001b4 Revert "[MM-37013] Async job to fix CRT channel unreads (#18340)" (#19319)
This reverts commit 0da249c651.
2022-01-12 18:51:47 +05:30
Allan Guwatudde
664af506a3 [MM-39583] - Intermediary web login page: Workspace Cookies (#19256)
* [MM-39583] - Intermediary web login page: Workspace Cookies

* only cloud

* fix error with license check

* feedback impl

* improvement

* make improvements

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-12 10:31:46 +03:00
Nick Misasi
8ad9a22e77 Add a field to ConfirmPaymentMethodRequest type (#19301)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-01-11 09:49:29 -05:00
Ibrahim Serdar Acikgoz
240bfb2244 Fix a couple of issues related with morph feature branch (#19302)
* uncomment s3 uploads

* remove unnecessary check from config validation

* remove translation
2022-01-08 13:01:37 +03:00
Ibrahim Serdar Acikgoz
6595b31f23 Replace go-migrate with morph (#19116) 2022-01-08 10:16:07 +02:00
Agniva De Sarker
93a9c6c293 MM-40852: Fix make gen-serialized breakage (#19291)
- Fixed the Makefile command so that it can be run in CI
- Changed to go install to make it compatible with >1.16 versions.
- Removed unnecessary lines in go.tools.mod now that we aren't using that.

```release-note
NONE
```
2022-01-07 20:02:54 +05:30
Ibrahim Serdar Acikgoz
4ce7d993a4 Merge pull request #19263 from mattermost/MM-40778-migration
Remove AcceptedTermsOfServiceId from Users table
2022-01-03 22:16:46 +03:00
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
Ibrahim Serdar Acikgoz
aa7eb64ff7 remove AcceptedTermsOfServiceId from users table 2021-12-30 18:32:24 +03:00
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