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

2095 Коммитов

Автор SHA1 Сообщение Дата
Julien Tant
a5ea445bf9 [MM-46097] Change FileInfo count query (#20871)
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-30 09:49:39 -07:00
Tim Scheuermann
eb37139f16 MM-45994 ensure database operations return their errors (#20857) 2022-08-26 11:12:59 +02:00
Shivashis Padhi
6adbcc5d05 MM-45899: Insights: least active channels (#20796)
* Add api endpoints, app layers for top inactive channels with dummy store calls

* Add store functions for top inactive channels

* Add model, store, app tests.

* Add client function and api tests

* Add participants information to TopInactiveChannel

* Translation fix

* Style fix while writing response

* Return channelmember IDs instead of profiles, query in batch avoiding inside the loop

* Make the following changes

 - move DeleteAt to subqueries, to avoid select, group by
 - Remove TeamId from response
 - Count bots and webhook posts

* SQL query lint fix, store test fix to include bot messages

* make app-layers

* Fix empty participant lists being sent as [""]

* Track channel joins, to distinguish 0 activity channels vs new channels

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-24 23:14:56 +05:30
Agniva De Sarker
8fd1762c3b MM-46503: Escape incorrect pg user search query (#20863)
There were 2 main problems after https://github.com/mattermost/mattermost-server/pull/20367.

1. The : wasn't escaped.
2. Empty search didn't work.

For 1, we escape the ':'. For 2, we just use
pattern search.

```release-note
NONE
```
2022-08-24 21:45:52 +05:30
Agniva De Sarker
492a3c0669 Warn on MariaDB servers (#20862)
```release-note
NONE
```
2022-08-23 14:17:45 +05:30
Shivashis Padhi
582812f1fc Merge branch 'master' of github.com:mattermost/mattermost-server into top-dms-clean 2022-08-12 17:00:55 +05:30
Martin Kraft
55b3961b98 MM-45120: Track team join times. Add API to retrieve new team members since a given time. (#20708)
* MM-45120: Starts tracking team join time. Adds API to retrieve team members who joined after a given time.

* MM-45120: Updates json casing to match model.User.
2022-08-11 10:38:52 -04:00
Shivashis Padhi
4ec3eade3b Merge branch 'master' of github.com:mattermost/mattermost-server into top-dms-clean 2022-08-10 21:00:57 +05:30
Tim Scheuermann
b4570afa90 Replace deprecated ioutil with io and os (#20776)
* Replace ioutil with io and os

* Replace ioutil in utils/file.go

* Minor fix to tests and excluded files

Co-authored-by: Tim Scheuermann <tim.scheuermann@mattermost.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-09 14:25:46 +03:00
Mattermod
4fc8ef0125 Merge branch 'master' into MM-45118_my_top_dms 2022-08-05 09:56:52 +03:00
Shivashis Padhi
3e36894ac7 Avoid joining with Posts table while getting top user reactions 2022-08-03 15:43:09 +05:30
Shivashis Padhi
45e434cc26 Fix issue with pagination where has_next is false for every case 2022-08-03 13:28:03 +05:30
Agniva De Sarker
334b199e7a Optimize AnalyticsPostCount (#20727)
We use * instead of a column name to use
index-only scan always even when other column filters
are applied.

Right now, index-only scan will only get applied
in the basic query of "select count(p.id) as value
from posts p". But it won't get applied if the query
is "select count(p.id) as value from posts p where
p.deleteat=0".

So this is a minor optimization which improves
some corner cases.

This was found from the slow query monitoring.

```release-note
NONE
```
2022-08-03 10:31:18 +05:30
Agniva De Sarker
ee41162b48 MM-46134: Skip flaky test PostStore//GetForThread (#20755)
https://mattermost.atlassian.net/browse/MM-46134

```release-note
NONE
```
2022-08-02 19:12:40 -04:00
Vishal
fa768e0fa7 [MM-45726] Fix Sentry crash: nil deference in app/post_helpers.go:85 (#20654)
* Avoid adding duplicate post
2022-08-02 12:10:26 +05:30
Dimitris Oik
8444c45959 MM-44576 autocomplete names including utf 8 chars (#20367)
* Added unaccent extension

* Changed comment

* Deletes migrations, changes query method

* Mionr changes

* Creates test for multilingual queries

* Minor formatting changes

* Adds two more tests

* Changes name in test function

* Minor change

* Retriggers tests

* Removes % from Postgres query

* Lint fix

* Changes variable name

* Removes SetDefaultTextSearchConfig method

* Removes mocks

* Adds error handling on test raw queries

* Lint fix

* Deletes unused generated file

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-08-01 06:58:31 -04:00
Shivashis Padhi
39ce85799a Merge branch 'MM-45118_my_top_dms' of github.com:plant99/mattermost-server into top-dms-clean 2022-08-01 14:04:53 +05:30
Shivashis Padhi
61a716a98c Fix Posts query while populating top DMs, add OutgoingMessageCount check to tests 2022-08-01 13:58:50 +05:30
Kyriakos Z
562388501e MM-43939: fixes LastReplyAt when deleting the last reply (#20615)
* MM-43939: fixes lastreplyat when deleting the last reply

Currently we are not updating the Threads.LastReplyAt when the last
reply gets deleted. This can lead to threads appearing unread when
actually there is no unread thread.

This commit updates the value of Threads.LastReplyAt when a reply gets
deleted, to the most recent post's timestamp in the thread.

* Updates ReplyCount to current value on post delete

* Addresses review comments

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-29 10:03:52 -04:00
Mattermod
8a532c0b8c Merge branch 'master' into MM-45118_my_top_dms 2022-07-29 10:46:32 +03:00
Shivashis Padhi
f84a6ae7ac Add TotalMsgCount to GROUP BY fields 2022-07-29 13:05:05 +05:30
Tim Scheuermann
832736da37 [MM-45990] log JSON parsing errors in API4 (#20724) 2022-07-28 17:05:03 +02:00
Shivashis Padhi
9f468cf011 Select total message count from Channel instead of counting posts 2022-07-28 17:22:14 +05:30
Shivashis Padhi
57e25b5d8f Add information on individual message count 2022-07-28 16:36:37 +05:30
Shivashis Padhi
f007d94155 Ignore self DMs 2022-07-28 12:46:18 +05:30
Shivashis Padhi
55bf7458d7 Temporarily add second participant information for self dms 2022-07-28 12:35:17 +05:30
Shivashis Padhi
e94532c862 SecondParticipant now has extended user object 2022-07-27 18:41:18 +05:30
Shivashis Padhi
849aea452c Merge branch 'master' of github.com:mattermost/mattermost-server into top-dms-clean 2022-07-27 17:03:34 +05:30
Agniva De Sarker
20cb042362 Hackathon: Post Reminders (#20555)
This PR adds the post reminder backend work.

We add a new API endpoint via which a user can set a reminder for a post. An ephemeral message will be sent down the line to let the user know about the action. And then after the time is over, the system admin bot will send a DM message to the user about the reminder post.
2022-07-26 16:12:56 +05:30
Shivashis Padhi
db192aff1b Lint fixes 2022-07-25 17:00:06 +05:30
Shivashis Padhi
870d86ae1d Save users to db in storetests, lint fix 2022-07-25 16:38:46 +05:30
Shivashis Padhi
b3330b1eb0 Fix boolean check of user.IsBot 2022-07-25 16:09:44 +05:30
Agniva De Sarker
fa9477d332 MM-45000: Upgrade to new opengraph module path (#20701)
https://mattermost.atlassian.net/browse/MM-45000

```release-note
NONE
```
2022-07-25 14:25:32 +05:30
Shivashis Padhi
5f56d43d80 Make the following changes
- Use db userId instead of referring to session
 - Filter out bot DM channels, and add relevant test
2022-07-25 14:07:08 +05:30
Shivashis Padhi
8e6f294fbd Lint, test fixes 2022-07-21 18:49:46 +05:30
Shivashis Padhi
2b66652f69 Fix top dms query, add storetests 2022-07-21 18:41:41 +05:30
Shivashis Padhi
a8fa09f946 Fix counting of posts, remove redundant limit offset for queries 2022-07-21 18:39:23 +05:30
Shivashis Padhi
0ab2189941 Add top DMs route and handlers 2022-07-21 18:39:03 +05:30
Tim Scheuermann
1f1d3785fe [MM-44365] Add values and operation to the condition checks (#20666) 2022-07-19 17:55:10 +02:00
Doug Lauder
2aaf4cf0fb Fix broken master; ensure all product service APIs have correct implementations (#20663)
* fix broken master; ensure all product service APIs are implemented by the structs passed to products

* use zero allocation interface checks
2022-07-15 13:20:40 -04:00
Agniva De Sarker
abd5384d9b Clarify collation mismatch string (#20641)
We replace expected/received with the source of the collation.

This makes it more clear as to from where the values
were retrieved.

```release-note
NONE
```
2022-07-13 12:11:03 +05:30
Shivashis Padhi
20d690b412 [MM-45444] Denormalize Reactions to add ChannelId for top reactions insights query (#20572)
* Denormalize Reactions to add ChannelId for top reactions insights query

* Remove hardcoded timestamps

* Fix store, api4 tests for reactions

* Fix tests

* Fix integrity tests, allow reaction to have ChannelId populated before calling store function

* Lint fixes

* Add ChannelId field to BulkGetForPosts, Delete store handlers

* Add index to mysql migration, add not null characteristic without a separate command

* Select channelId instead of fetching post via store.GetPost, add if exists to drop column

* Make updating of Reactions conditional to support pre-migration

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-07-11 09:25:03 -04:00
Martin Kraft
a46840e96b MM-45395: Exclude bot and webhook posts from Top Team Channels. Exclude webhook posts from My Top Channels. (#20599)
* MM-45395: Exclude bot and webhook posts from Top Team Channels. Exclude webhook posts from My Top Channels.

* MM-45395: Adds missing error test.

* MM-45395: Adds missing whitespace.
2022-07-11 08:58:40 -04:00
Vishal
e5ee5eecd8 [MM-44488] Cloud limits: enforcing messages (#20362)
* Add new Job to keep updating the last_accessible_post time

* Filter out posts for funcs returning PostList model

* Separate methods to get and compute cache

* filter pinned posts

* For posts with sorted CreateAt order, support a faster form of filtering.

* Add inaccessible header for getPost and getPostsByIDs APIs

* replace manual binary search with the std. library

* in-place filter posts

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Nathaniel Allred <neallred@protonmail.com>
2022-07-06 11:56:39 +05:30
Ibrahim Serdar Acikgoz
717a4d04a9 Use any instead of interface{} (#20577)
* replace interface{} with any
2022-07-05 09:46:50 +03:00
Julien Tant
b45ff0be5d [MM-44159] Add user sort by admin status in channels (#20562) 2022-06-30 09:20:14 -07:00
Doug Lauder
91877c3016 Add Store service for Focalboard multi-product architecture (#20568)
* add Store service
2022-06-30 08:28:37 -04:00
Agniva De Sarker
bd6acf04a9 GraphQL: Create dedicated top-level filter for sidebar categories (#20353)
We add the excludeTeam switch to allow user to get
all sidebar categories from other teams excluding a given team.

```release-note
NONE
```
2022-06-28 20:28:50 +05:30
Ashish Bhate
7793aebfbb Revert "MM-45000: Change dyatlov dependency (#20443)" (#20506)
This reverts commit 680b00047f.

Reverts the recent opengraph update to fix some issues with our plugins
2022-06-20 20:34:41 +05:30
Shivashis Padhi
2cd83d2f8d [MM-44084] Feature: Top threads insights (#20195)
* Add route endpoints, model, store functions, and tests for top threads

* Run make store-layers

* Make the following changes

 - Fix top user threads query
 - Fix passing parameters in api4/insights.go to handler in app
 - Add top user threads test

* Add post-message, user_id, participants information to insights results

* model.TopThread.UserID -> model.TopThread.UserId, for compatibility with MySQL

* Rename name -> channel_name

* Add user information to response

* Link post in response, filter out deleted root posts from top threads

* Handle thread delete cases, add app tests for threads insights

* lint: fix typo

* lint: rename asserts

* lint: require.nil -> require.NoError

* Add integration tests for thread insights

* Add embeds and images to top posts

* Add license checks for top threads endpoints

* Query users in batch to populate post-creator

* Make the following changes

 - Add license to test server in api4/
 - Add tests for threads insights
    - top team threads shouldn't include threads from other teams, DMs
    - Test duration constraint
    - Pagination testing for top threads in model/insights_test.go

* Add i18n-extract

* i18n fixes

* Add username, nickname to user_information

* Hide message, user_id, post_id, reply_count in depth=1 of top threads response

* Fix tests using response.reply_count to use response.post.reply_count

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-06-20 10:27:17 -04:00