Commit Graph

192 Commits

Author SHA1 Message Date
Harrison Healey
4a23d4b282 MM-20681 Fix custom post types not marking channel unread when using Mark as Unread (#13247)
* MM-20681 Fix custom post types not marking channel unread when using Mark as Unread

* Fix inverted if statements
2019-12-03 14:51:50 -05:00
Harrison Healey
a0130b86d7 MM-20649 Fix incorrect mention count when marking a DM channel as unread (#13245)
* MM-20649 Fix incorrect mention count when marking a DM channel as unread

* Satisfy govet

* Update missed test
2019-12-02 09:30:08 -05:00
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
Miguel de la Cruz
2259b7f2a8 [MM-19948] Set version on module file and internal paths (#13186)
* [MM-19948] Set version on module file and internal paths

* Fixes after merge

* Fix i18n checker error
2019-11-28 14:39:38 +01:00
Harrison Healey
e5dbd45f94 Merge branch 'master' into mark-as-unread 2019-10-17 09:44:32 -04:00
Eli Yukelzon
66c66eef0d MM-19371 - Reply count disappears from pinned and flagged conv… (#12753) 2019-10-17 11:10:49 +03:00
Harrison Healey
3039081161 Fix merge conflicts 2019-10-15 12:10:40 -04:00
Harrison Healey
84714f5cff Merge branch 'master' into mark-as-unread 2019-10-11 16:09:00 -04:00
Eli Yukelzon
34b4bbcb46 MM-18623 - invalid reply-count displayed (#12364)
* fixed thread creator, fixed default behaviour of fetching posts
* handle reply-count in getPostThread code path
2019-10-10 17:14:44 +03:00
Harrison Healey
e6f67c664c MM-17071 Add mention counting when marking a post as unread (#11966)
* Add different types for different mentions

* Remove redundant THREAD_ANY and THREAD_ROOT constants

* Make PostStore.Get return thread in order

* MM-17071 Add initial version of countMentionsFromPost

* MM-17071 Refactor comment mention counting

* MM-17071 Use mention counting when marking post as unread

* Fix shadowing in tests

* Remove repeated check of user count

* Refactor code using MentionType

* Update comments around -1 return value

* Move inner functions out of countMentionsFromPost

* Remove preconditions check as separate test case

* Update comments

* Add User.GetMentionKeys

* Revert "Make PostStore.Get return thread in order"

This reverts commit 22aa010cee.

* Fix tests

* Fix merge conflict

* Add store.MentionAllPosts
2019-09-19 10:10:10 -04:00
Eli Yukelzon
b3517eaf2f MM-17468 - Improving performance of fetching threads (#11980)
fetchThreads parameter support in the API
2019-09-17 14:37:10 +01:00
Nikhil Ranjan
b7a879b985 Converting to structured logging the file app/post.go (#12138) 2019-09-12 10:27:04 -05:00
Harrison Healey
bd270aecbd MM-17071 Remove auto responder logic from App.SendNotifications (#11789)
* MM-17071 Remove auto responder logic from App.SendNotifications

* Log errors returned by SendAutoResponseIfNecessary
2019-08-19 14:15:09 -04:00
Siyuan Liu
e4bb8cd887 MM-11359: support excluding results from search (#11196) 2019-08-12 14:03:42 +02:00
Jesse Hallam
f44473e062 MM-17339: fix missing post thread (#11729)
* leverage testify for TestGetPostsForChannelAroundLastUnread

* introduce assertPostList helper

* unit test MM-17339

* fix MM-17339
2019-07-30 17:27:18 +08:00
Jesús Espino
e067272e16 Cleaning the store from functions returning StoreResult (#11602)
* Cleaning the store from functions returning StoreResult

* Removing unnecesary StoreChannel type
2019-07-29 12:38:46 +02:00
Miguel de la Cruz
8f4e03a52b [MM-15925] Add includeDeleted flag to GetForPost in FileInfoStore (#11585) 2019-07-15 08:54:30 +02:00
Harrison Healey
673ed02a0d MM-16543 Fix Elasticsearch only returning one page of results (#11528)
* MM-16543 Add mocking for einterfaces packages

* MM-16543 Fix Elasticsearch only returning one page of results

* Remove license checks for einterface mocks
2019-07-08 08:32:29 -07:00
Mounica Paladugu
89d8dd6816 [MM-15854] Migrate "Post.Search" to Sync by default (#11002)
* Migrate Post.Search to Sync by default

* app/post.go channels modification

* Removing tabs

* Removing tabs

* Reverting GetEtag modification

* Fixing channel corruption error

* Adding Done signal for goroutines

* remove fixed length wg

* undo wg short declaration

* Removing one comment

* Fixing change

* Fixing store mocks

* Fixing typo
2019-07-07 15:10:04 +02:00
Saturnino Abril
b832985f1d MM-11210 Add "GET /posts/unread" API to support landing on the last unread post (#11486)
* [MM-11210] Add API GET 'api/v4/channels/{channel_id:[A-Za-z0-9]+}/posts/unread' for scrolling overhaul (#9108)

* Add API GET 'api/v4/channels/{channel_id:[A-Za-z0-9]+}/posts/unread'

* add constants

* refactor GetPostSince and added more tests

* move constants to app package

* [MM-11528 &&  MM-11583] Add userId to in the "posts/unread" path and update test with time delay to fix intermittent failure (#9229)

* add userId to in the "posts/unread" path and update test with time delay to fix intermittent failure

* add limit before and after to query

* remove time delay on test and put pretermined value of Post.CreateAt

* Fix conflict

* [MM-11876] Add cursor to posts list such as next_post_id and previous_post_id (#9707)

* add cursor to posts list such as next_post_id and previous_post_id

add publish previous_post_id on WEBSOCKET_EVENT_POSTED and only get next or previous post IDs if necessary

revert change on adding previous_post_id in WEBSOCKET_EVENT_POSTED

add missing strings import

fix merge conflicts

* update per comment

* update per feedback

* corrected the logic in getting the next and previous post ID

* fix logic to determine next and post IDs, and rename function to have suffix of "Time"

* rearrange logics and add mote tests

* fix merge conflict

* fix missing message when using unread API (#10233)

* MM-15569 Fixes failing test on TestGetPostsForChannelAroundLastUnread (#11039)

* Fix missing posts when getting posts since

* revert changes to GetPostsSince

* migrate Post.GetPostAfterTime and Post.GetPostBeforeTime to sync by default

* revert change to cacheItem

* Fix post ID validation, build query on squirrel and only return post ID as necessary
2019-07-04 02:53:04 +05:30
piperRyan
5c32f92413 [MM-16330] Migrate "Channel.GetForPost" to Sync by default (#11199) 2019-06-19 10:27:09 +02:00
Miguel de la Cruz
406dcb1311 [MM-15811] Adds fallback mechanism for elasticsearch queries (#11065)
* [MM-15811] Adds fallback mechanism for elasticsearch queries

* Rename config helpers
2019-06-18 14:43:08 +01:00
Taufiq Rahman
e101e1c020 Migrate "Post.GetPostsSince" to Sync by default #10976 (#11129)
* Migrate "Post.GetPostsSince" to Sync by default #10976

* Update GetPostsSince to Sync by default #10976

* Update GetPostsSince to Sync by default #10976

* Update GetPostsSince to Sync by default #10976
2019-06-14 09:22:47 -04:00
Jesper Hansen
570e6f1a74 [MM-15841] Store: Migrate "Post.Save" to Sync by default (#11045)
* MM-15841: migrate post save to sync by default #10987

* MM-15841: remove variable shadowing #10987

* MM-15841: log error on post save #10987

* MM-15841: nil check post save errors #10987

* MM-15841: update error message on post save #10987

* MM-15841: add nil check on post save in user store test #10987
2019-06-14 12:02:33 +02:00
Tomas
76eee12ac8 MM-15850/MM-15851 GetPosts Before/After sync by default (#11035) 2019-06-08 06:32:23 +02:00
Evan do Carmo
c73bc21d1e #10883 adding const error string DismissPostError to be returned by MessageWillBePosted (#10921)
Adds an exported const string that can be used by plugins to signal a client that the incoming post should be dismissed, instead of the current behavior which just leaves it pending.
2019-06-06 06:16:28 +02:00
GianOrtiz
b26e5d444e Migrate "Post.GetPostsByIds" to Sync by default (#11034) 2019-06-04 17:25:16 -04:00
Rodrigo Villablanca Vásquez
201fb5a717 Fix #10979. GetFlaggedPostsForChannel is sync now (#11010) 2019-06-03 14:29:09 +02:00
Rodrigo Villablanca Vásquez
e20d91b00e Fix #10975. GetEtag is sync now (#11011)
* Fix #10975. GetEtag is sync now

* Revert of modifications to go.mod and go.sum
2019-05-31 17:58:24 -04:00
Evan do Carmo
cee1e36859 MM-15846 migrating get posts to sync by default (#10994)
* migrating get posts to sync by default

* flow control and style changes

* style changes, error checking

* pulling master down

* counting missed cache, not hit

* fixing bad conflict resolution

* forcing rebuild
2019-05-30 10:44:33 -04:00
Evan do Carmo
427effcd5c MM-15843 migrating post.GetSingle() to sync by default (#10992) 2019-05-30 14:43:45 +02:00
Evan do Carmo
8ff58a07bd MM-15842 making post.update() sync by default (#10991)
* making post.update() sync by default

* fixing style issues

* style changes

* fixing variable name
2019-05-30 10:35:46 +02:00
Evan do Carmo
9f4c703f1e MM-15847 migrating getFlaggedPosts to sync by default (#10995) 2019-05-29 18:05:59 +02:00
Evan do Carmo
28d668cd91 MM-15848 migrating getFlaggedPostsForTeam to sync by default (#10996) 2019-05-29 16:48:05 +02:00
Elias Nahum
9dc14d63b7 Trim leading and trailing spaces for search terms (#10989) 2019-05-28 13:04:12 -04:00
Woolim Cho
d28f56c61e Migrate Preference.DeleteCategoryAndName to Sync by default (#10940) 2019-05-27 11:40:49 -04:00
Jesús Espino
87ff64ea6d MM-15035: Read from file infos from master on post creation (#10899)
* MM-15035: Read from file infos from master on post creation

* Handling edit post cases for get files metadata
2019-05-23 14:29:41 +02:00
PR
0b6acaa9ba GH-10761: Migrate Post.Get to sync by default (#10831)
* GH-10761: Migrate Post.Get to sync by default

* instantiate storeChannel with make

* fix go vet issue

* fix go vet issue

* use select for checking channel for value

* fix go vet shadow variable issue

* addressing review comments

* call post.Get() in goroutine

* refactor minor values to fix tests

* fix: remove err error type, it should be *model.AppErr
2019-05-21 11:01:30 -07:00
PR
6d2fa0f3d2 Migrate Overwrite and GetMaxPostSize() in PostStore to sync by default (#10829)
* Migrate Overwrite and GetMaxPostSize() in PostStore to sync by default

* GH-10762: fix return type for mock func

* GH-10762: fix tests for MaxPostSize() mocks

* fix imports
2019-05-17 10:46:18 +02:00
Lev
2d3e417833 MM-15632 DeleteEphemeralMessage to accept a postId string (#10853)
Before it was accepting `post *model.Post`, and returning one.
This is a breaking change for the giphy plugin and any other that rely
on the API.
2019-05-16 12:32:13 +02:00
Jesús Espino
beb7592c93 Migrate FileInfo store to Sync by default (#10837) 2019-05-15 22:07:03 +02:00
PR
b3aa3d4567 GH-10760: Migrate Post.Delete to sync by default (#10830) 2019-05-13 13:07:15 +02:00
scott lee davis
74c7c46a7d Support webapp to render post rapidly for bot without additional call for user/bot. (#10793) 2019-05-10 11:04:52 -04:00
Jesús Espino
c8920588a0 Adding new "VIEW_MEMBERS" permissions restrict the scope of users visibility (#10487)
* MM-14138: Adding new "VIEW_MEMBERS" permissions restrict the scope of users visibility

* Fixing gofmt

* Fixing broken tests

* Addressing PR review comments from Miguel de la Cruz

* Removed hack

* A bit nicer and cleaner code in the UserBelongsToChannels function

* Adding cluster cache invalidation for user team ids

* Checking in the correct order permissions to not leek existency information

* Adding restrictions to TeamMembers and User status requests

* Fixing tests

* Fixing status endpoint permissions checks

* Adding more tests

* Fixing tests

* More tests and making the restrictions query based only on joins

* Adding more tests

* Adding more tests

* fixing merge problems

* Reverting status changes to avoid performance issues

* Adding more tests

* Fixing test

* i18n extract

* Adding extra method for get restrictions for a team

* Add the new elasticsearch functions to search users with restrictions

* Add missing translation string

* Rename restrictedChannelIds to restrictedToChannels

* Remove ToDo

* Adding the permission to the SystemAdmin role during permissions migrations
2019-04-29 16:56:56 +02:00
tengis b
8252eab5da [MM-15274] Migrate "Team.Get" to Sync by default (#10694)
* Migrate Team.Get to Sync by default

* change parseRange return value to ok

* fix formatting

* remove err checks

* use require.nil

* require nil
2019-04-26 18:18:07 +02:00
Andres Orozco
928ecba2d4 MM-15198 Migrate Channel.Get/GetFromMaster to Sync by default (#10667)
* MM-15198 Migrate Channel.Get/GetFromMaster to Sync by default

* MM-15198 - Update store/storetest/post_store.go

fix error handling in post_store.go test case

Co-Authored-By: andresoro <ao15@my.fsu.edu>
2019-04-24 20:28:06 +01:00
Martin Kraft
84a59ddb39 MM-14417: Messaging for mentions of users who are not in associated channel groups. (#10594)
* MM-14417: Adds support for out-of-channel notifications of users who are not in associated groups of group-constrained channels.

* MM-14417: Fix for mobile backwards compatibility.
2019-04-17 10:44:45 -04:00
Jesús Espino
12c50eb830 Initial migration of the store to be sync (#10592)
* Migrating audit store

* Final migration example for the audit store

* async example

* Ending migration

* Removing Async helper

* Fixing tests

* Fixing govet problems with the StoreResult instanstiation
2019-04-15 22:53:52 +02:00
Daniel Schalla
7c9837d9b1 [MM-14846] Update EditAt for FileIds and Attachment in Post + Ignore FileIds Updates (#10540)
* Set EditAt for FileIds and Attachments; Disallow update/patch of FileIds in API Handler

* Add custom comparison methods for StringArray and Post Attachments

* gofmt

* Split up comparison function to child structs

* Naming consistency

* gofmt
2019-04-04 20:01:21 +02:00
Elias Nahum
4cc75fc062 MM-14532 Send "clear" notification to every other session (#10459) 2019-03-18 15:34:34 +01:00