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

1418 Коммитов

Автор SHA1 Сообщение Дата
Martin Kraft
bf9d1166d6 MM-49688: Handles an empty mysql.time_zone_name table. (#22093) 2023-01-18 19:41:13 -05:00
Mattermost Build
357428dfb0 Merge branch 'master' into MM-47853-true-up-review-telemetry-off-non-air-gapped 2023-01-17 08:45:44 +02:00
Konstantinos Pittas
1fdedf30f1 Revert "[MM-46579] Add a limit for preferences" (#22086) 2023-01-16 15:30:14 +02:00
Alejandro García Montoro
360d590728 Skip TestReplicaLagQuery until MM-49604 is fixed (#22048) 2023-01-12 16:13:32 +01:00
Konstantinos Pittas
3ad240c167 [MM-46579] Add a limit for preferences (#21780)
* add a limit for preferences

* add limits to preferences

* add config to telemetry

* remove unneeded tags from config
2023-01-12 13:17:53 +02:00
Agniva De Sarker
a9bac806f3 MM-39215: Add DBStatsCollector to metrics (#21957)
https://mattermost.atlassian.net/browse/MM-39215

```release-note
We now have Grafana metrics for DB connection metrics.
They are:
max_open_connections
open_connections
in_use_connections
idle_connections
wait_count_total
wait_duration_seconds_total
max_idle_closed_total
max_idle_time_closed_total
max_lifetime_closed_total
```
2023-01-11 08:39:54 +05:30
Agniva De Sarker
079f752478 MM-49546: Sentry crash: fix nil pointer dereference (#22018)
We return a store error always to be handled correctly
at the app layer.

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

```release-note
NONE
```

Co-authored-by: Mattermost Build <build@mattermost.com>
2023-01-09 22:25:29 +05:30
Mattermost Build
c0fd11f953 Merge branch 'master' into MM-47853-true-up-review-telemetry-off-non-air-gapped 2023-01-09 16:53:36 +02:00
Alexander Griesser
fd4019630f Remove superfluous "channel" in comment (#21887)
Automatic Merge
2023-01-06 08:49:11 +02:00
Conor Macpherson
a839646757 Fix typo, ensure we don't throw away errors that are not store.NotFound. 2022-12-28 10:01:20 -05:00
Conor Macpherson
3c0375d18e Fix error type checks, change log levels, update comments. 2022-12-28 09:56:58 -05:00
Conor Macpherson
c633a1d2fa Code review comments. 2022-12-27 16:03:04 -05:00
Conor Macpherson
40c94892ee Merge branch 'master' of github.com:mattermost/mattermost-server into MM-47853-true-up-review-telemetry-off-non-air-gapped 2022-12-27 11:20:09 -05:00
Vishal
dc533e59b8 Message export: Fix job progress calculation (#21925)
* use posts count instead of job duration to calculate progress

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-12-27 14:34:40 +05:30
Mattermod
b4d9d12856 Merge branch 'master' into MM-47853-true-up-review-telemetry-off-non-air-gapped 2022-12-23 23:12:20 +02:00
Conor Macpherson
64000da417 Convert due date string to millisecond format. 2022-12-23 15:37:31 -05:00
Conor Macpherson
6daa39fd62 Fix mysql migrations and db tests. 2022-12-23 11:08:41 -05:00
Agniva De Sarker
1e02b99bf1 MM-49354: Make compliance export query cancellable (#21943)
We accept a context that can cancel the query.
This allows us to exit a job faster.

```release-note
Compliance export job can now cancel the SQL query
execution during server shutdown which will allow
the job to exit faster.
```

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-12-23 19:56:49 +05:30
Conor Macpherson
40fbb00acc Remove auto create if no records present, add new error message. 2022-12-23 09:18:14 -05:00
Ibrahim Serdar Acikgoz
40cd6b1656 sqlstore/store: make SetupConnection public to be used by products (#21948) 2022-12-23 14:34:48 +03:00
Conor Macpherson
cedfc46bd9 Add more tests, add mocks. 2022-12-22 15:40:26 -05:00
Conor Macpherson
88090ea40b Add true up review status history, add migration for persisting history, add store to create, get, and update true up review history entries, cleanup errors, etc. 2022-12-22 14:59:05 -05:00
Kyriakos Z
37960c7680 MM-49077: fixes errors in migration job (#21911)
* MM-49077: fixes errors in migration job

UrgentMentionCount does not have a default values, so COALESCE has to be
used.
SELECT * FROM ChannelMembers fails for the above reason.
This commit SELECTs each and every column from ChannelMembers instead.

* Fixes syntax error

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-12-22 16:15:11 +02:00
Conor Macpherson
f65aa61440 remove webhook queries in favor of using existing ones that ignore deleted webhooks, enforce not implemented for cloud users, get seats from license.features.users. 2022-12-21 12:09:33 -05:00
Tim Scheuermann
0ce7c5e3da Use path rather than filepath for embedded files (#21896)
Co-authored-by: Tim Scheuermann <tim.scheuermann@mattermost.com>
2022-12-20 08:59:40 +01:00
Conor Macpherson
12328278f8 Merge branch 'master' of github.com:mattermost/mattermost-server into MM-47853-true-up-review-telemetry-off-non-air-gapped 2022-12-19 15:40:03 -05:00
cyrilzhang-mm
33b59e0e96 Add parameter to return group members in order of display name (#21775) 2022-12-15 14:20:36 -05:00
Claudio Costa
6fd174a95f [MM-48946] Fix read after write issue when uploading data (#21868)
* Fix read after write issue when uploading data

* Prefer request.CTX interface
2022-12-13 11:47:05 -06:00
Conor Macpherson
c0735ae689 Add route with functionality for building out the true up review profile. 2022-12-08 16:11:43 -05:00
Konstantinos Pittas
6e9dbbd237 [MM-46463] Return last_picture_update for new team members (#21758)
* return last picture update

* add API test

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-12-07 11:16:56 +02:00
Kyriakos Z
a240cd53eb MM-48614: saves priority for drafts (#21752)
* MM-48614: saves priority for drafts

Adds a new column in the drafts table, "priority".
This way we can save post's priority in the draft.

Fixes OmitConnectionId, which when you published a ws event for a user
was getting bypassed.

Fixes Get for drafts returns deleted ones as well, which is needed for
upsert.

* Adds test case for the OmitConnectionId

* Addresses review comments, removes DeleteAt

* Vets

* Adds missing translation

* Re-instates DeleteAt column

* Adds separate case to get draft including deleted

* Fixes Update Draft

* Empty
2022-11-29 23:36:47 +02:00
Martin Kraft
3e7a8d8426 MM-48181: Invalidate cache to reflect permissions changes from a team scheme. (#21735)
* MM-48181: Bust the allChannelMembersForUserCache when assigning a team scheme.

* MM-48181: Tests cache fix.
2022-11-28 11:18:17 -05:00
Martin Kraft
a05dd722ed New isrole replacement (#21688)
* Adds new function to use in place of isRole that includes team and channel schemes.

* Adds tests. Fixes code.

* Adds warning to isRole.

* Fixes phrasing.

* Added more docs.

* Moved from strings to constants.

* Added some spacing and improved some comments.

* Renames some functions.

* Rename isNotRole to isNotExactRole. Add a new isNotRole function.

* Switch to only checking prefix.

* Ignores unused function warning.

* Lint fix.

* Switch from unused to deadcode.

* Adds test for isNotRole.
2022-11-24 07:41:09 -05:00
Kyriakos Z
5e5769c4ee MM-45317: global drafts endpoints and ws events (#20614)
* MM-23881: global drafts endpoints and ws events

Adds endpoints:
- create/update drafts
- delete draft
- get drafts

Adds WS events:
- draft_updated
- draft_created
- draft_deleted

* Ordering and WS event name fixes

* Adds PostID to the drafts table

In the future the drafts will include edited posts, this commit adds the
post id in the combined pkey of the table.

* Fixes route for deleting a thread draft

* Fixes failed checks

* Fixes migrations

* Fixes migration

* Extract translation strings

* Removes PostID since we won't sync editing posts

* Fixes tests

* Fixes i18n

* Update migrations for global drafts

* update branch with latest master changes

* Add feature flag for global drafts

* Set global drafts feature flag default to true

* Added support for files in drafts

* Fix failing i18n check

* Added support for deleting files in drafts

* Revert "Added support for deleting files in drafts"

This reverts commit 45dfd04a760359de2e8814d652c9ef46daf994f6.

* Triggering new test server

* Add config setting 'AllowSyncedDrafts' for syncing drafts with server

* Triggering new test server

* Triggering new test server

* Add guard for config setting and add initial tests

* Fix i18n and lint errors

* Triggering new test server

* Add tests for drafts

* fix lint issues

* Add tests for model/draft

* Triggering new test server

* Triggering new test server

* Trigger new test server

* Address PR comments

* Change left join to regular join in GetDraftsForUser

* Fix broken test

Maybe consider adding an inclDeleted field if we want to get deleted drafts in the future

* fix translations

* Add store tests for drafts

* fix test naming

* remove comment

* update migrations

* set feature flag default to false

* update migrations

Co-authored-by: Mylon Suren <mylonsuren@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-23 22:21:40 -05:00
Kyriakos Z
27db854089 MM-47750: Adds PostAcknowledgements table and apis (#21689)
* MM-46410: adds urgency on mention counts

We have introduced priority for posts in
https://github.com/mattermost/mattermost-webapp/pull/10951.
We do need to color the mention badges in the webapp with a prominent
color when a mention is posted in an urgent message.
A thread has urgent mentions if the root post is marked as urgent, and
the replies contain mentions to the user viewing the thread.

This PR adds two columns, urgentmentioncount, and isurgent, in
channelmembers, and threads tables respectively.
Furthermore when asking for team/thread mention counts, we also return
urgent mention counts for the user.

* Fixes method in tests

* empty commit

* Fixes method call

* Fixes single thread response is_urgent

* Fixes errors

* Fixes mysql migration and adds graphql schema

* Fixes tests

* Refactors IsUrgent and Adds PostsPriority table

Changes:
- removes is_urgent from the threads table
- adds a new table to hold posts priorities
- refactors priority out of the props and into the new table

* Fixes

* Adds translation strings

* Fixes migrations and tests

* Fixes tests

* empty

* Adds Priority to Copy

* empty

* Fixes priority not saved when boards is enabled

We are nilifying Metadata when post.ForPlugin(), which didn't save Priority
for a post when Boards was enabled.
This commit copies metadata again to the post, so metadata are
reinstated.

* Fixes tests

* Adding store tests and fixes syntax error

* Uses threads.ThreadTeamId

* Fixes error

* Adds UrgentMentionCount in graphql api test

* Fetches post priority in batches

* Addresses review comments

* Restore only priority on create post

* Fixes tests

* Nits

* Some refactoring

* Fixes get thread options when post priority enabled

* Adds missing translation

* Use the constant instead of "urgent" string

* Renames urgent constant

* MM-47750: Adds PostAcknowledgements table and apis

- Adds post acknowledgement api/app/store methods to be able to save and
delete post acknowledgements by users.
- Adds wesbsocket events for acknowledgement created/deleted
- Returns post acknowledgements in the post's metadata

* Empty

* Fixes incorrect urgent count when marking a post as unread

* Adds license

* Fixes ACK api, and adds tests

* Fixes vet

* Fixes tests

* Addresses review comments

* Remove unnecessary lines

* Adds config option and changes return of delete ack

* Empty

* Empty

* Enable config by default

* Fixes intl

* Fixes test after setting config default true

* Changes endpoints to PostForUser

* Avoids replica lag

* Fixes error in merge

* Fixes RetryLayer tests due to merge

* Empty

* Empty

* Empty

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-23 19:41:23 -05:00
Kyriakos Z
c44d37629a MM-46410: adds urgency on mention counts (#20999)
* MM-46410: adds urgency on mention counts

We have introduced priority for posts in
https://github.com/mattermost/mattermost-webapp/pull/10951.
We do need to color the mention badges in the webapp with a prominent
color when a mention is posted in an urgent message.
A thread has urgent mentions if the root post is marked as urgent, and
the replies contain mentions to the user viewing the thread.

This PR adds a column, urgentmentioncount, in channelmembers.
Furthermore when asking for team/thread mention counts, we also return
urgent mention counts for the user.

Adds a new table to hold posts priorities
Refactors priority out of the props and into the new table

We are nilifying Metadata when post.ForPlugin(), which didn't save Priority
for a post when Boards was enabled.
This commit copies metadata again to the post, so metadata are
reinstated.

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Vishal Choudhary <vish9812@gmail.com>
2022-11-23 21:08:21 +02:00
Vishal
c78b78ed5e [MM-5046] Fix emails search for Postgres DB (#21590)
* Support emails search in Postgres

* Add @ exception for postgres

* update comment

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-22 12:02:33 -05:00
Ben Cooke
76f7872a50 [MM-46692] Channel group member count (#21270)
* tools updates

* Revert "tools updates"

This reverts commit 6293297b55803c5a263e200ebd80192899666ae9.

* adding channel member count to groups request

* fixing models

* adding a new test

* removing unused var

Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.ht.home>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MBP.fritz.box>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.fritz.box>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-22 11:31:04 -05:00
Ibrahim Serdar Acikgoz
1edbf67bb2 migrations: bump morph dependency and reflect changes (#21670) 2022-11-17 19:36:08 +03:00
Shivashis Padhi
5be8557247 [MM-44168] Add feature to restore archived user groups (#20369)
* Add undelete feature, add mocks, tests

* Rename undelete->restore

* make store-layers

* make app-layers

* Store -> Store()

* Lint fixes

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-17 14:53:54 +05:30
Shota Gvinepadze
98e685f07c Move Thread.GetPosts to PostStore.GetPostsByThread (#21633)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-11-16 13:42:26 +04:00
Shota Gvinepadze
44dd185506 Fix bad merge (#21632) 2022-11-10 11:30:49 +04:00
Jesse Hallam
5a0a3e6d13 Inline ThreadStore.MarkAllAsUnreadByTeam (#20958)
* Add teamId to Threads table

* Get rid of multiple teamId reads

* Fix failed test

* Inline ThreadStore.MarkAllAsUnreadByTeam

The query to `MarkAllAsUnreadByTeam` first fetched all thread memberships, then fed just the ids back to a second query to ensure all are marked as unread. Optimize this by simply doing a single `UPDATE` query with the necessary joins.

Co-authored-by: iomodo <wineson@gmail.com>
2022-11-09 14:00:07 -04:00
Shota Gvinepadze
b9d00a1f28 Simplify thread_store/GetThreadForUser (#21588) 2022-11-09 12:16:20 +04:00
Tim Scheuermann
033bdd6f1a Fix unchecked request when saving channel (#21043) 2022-11-07 11:28:31 +01:00
Ben Cooke
d855916c6e [MM-48049] Including users who were removed from group in not_in_group response (#21559)
Automatic Merge
2022-11-04 19:10:26 +02:00
Tim Scheuermann
b73bf144aa MM-47171 Export direct channel favorites (#21570) 2022-11-04 17:13:14 +01:00
Jesse Hallam
279754c6b0 Refactor common JoinThread helper struct (#21511)
* Refactor common JoinThread helper struct

* avoid exporting ToThreadResponse
2022-11-04 12:05:59 -03:00
Daniel Espino García
376f70842d Send deleted posts on getPostSince when collapsed threads is enabled (#20976) 2022-11-02 11:14:28 +01:00
Zubair Ahmed
79e4959d02 Return empty list of channels when requesting more channels at the end of cursor (#21557) 2022-11-02 15:10:51 +05:30