Commit Graph

1323 Commits

Author SHA1 Message Date
Allen Lai
223db0c05c MM-20105: Migrate channelByNameCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13189)
* migrate

* add unit test

* change syntax

* delete comments

* remove includedeleted search method

* remove include search method in correct file

* change constant

* add Mock.On

* change to &channel

* fix type for Mock.on().return()

* remove inc counter

* suggestions takened

* get rid of unneeded concat

* go fmt

* import v5
2019-12-04 06:55:02 +01:00
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
Ben Schumacher
d0d6ce0a70 [MM-20353] Change KVSetWithOptions to accept a byte slice (#13213)
* Drop EncodeJSON from PluginKVSetOptions

* Add unit tests for KVSetWithOptions with nil values
2019-12-03 10:46:15 +01: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
Eli Yukelzon
4e5369e759 MM-19957 - Deactivating a user should increment the Daily and… (#13232)
* corrected active count function
2019-12-02 15:48:36 +02:00
Sanele T. Mahlalela
81cff677b1 fixed localcache emoji layer test description (#13206) 2019-12-02 11:06:11 +01: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
Rodrigo Villablanca Vásquez
e03411795c Migrating team store cache to cache layer (#13075)
Automatic Merge
2019-11-29 05:56:50 -05:00
larkox
d2e78e28a9 [GH-13105] Migrate channelPinnedPostCountsCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13164)
* Migrate channelPinnedPostCountsCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer

* Remove GetPinnedPostCountFromCache

* Rearrange test to avoid undeclared variable
2019-11-28 15:21:42 -05: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
Martin Kraft
14bcd1f0a1 MM-18357: Adds pagination to team search. (#12910)
* MM-18357: Adds pagination to team search.

* MM-18357: Adds new client method for paginated requests.

* MM-18357: Adds feedback about non-supported pagination-permissions combo.

* MM-18357: Removes unnecessary conversion.

* MM-18357: Removes paginate parameter and uses nil on page and perpage instead.
2019-11-28 08:11:02 -05:00
catalintomai
955f8c4e8e MM-19956: Add edit and delete post message export tests. (#13156)
* MM-19956: Add edit and delete post message export tests.
2019-11-27 21:05:53 -08:00
Allen Lai
fdec1ef1f5 MM-20100: Migrate channelGuestCountsCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13135)
* init

* migrate

* add test

* fix channel store

* ...

* missing ')'

* change function interface

* fix build

* fix format

* Update store/localcachelayer/layer.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* Update store/localcachelayer/channel_guest_layer_test.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* im so confused why my builds are failing

* fix build

* format

* fix format

* add license header

* resolve some conflicts

* add test

* fix constant names

* fix more constants

* fix bugs

* delete unused constants

* Update store/localcachelayer/channel_layer.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* typo

* another typo

* get guest

* change test

* go fmt format

* change test

* remove getcountcache

* delete method from interface

* delete method

* update test

* rerun GoLang CI
2019-11-27 09:14:40 -05:00
Martin Kraft
31ac88ef69 MM-20305: Adds ability to choose whether deleted teams are included in the count query. (#13181) 2019-11-27 07:50:15 -05:00
Rodrigo Villablanca Vásquez
27375cd081 Migrate profileByIdsCache cache to cache layer (#13133)
* Partial advances

* Small advances

* invalidating cache with doInvalidateCacheCluster

* Renamed cache

* Starting with tests (failing by now)

* Passing tests :)

* Passing tests

* Fix ineffectual assignment in tests

* Revert of backward incompatible change

* Removed unused var
2019-11-25 21:18:01 +01:00
larkox
22b495b2df [GH-13058] Migrate webhookCache from store/sqlstore/webhook_st… (#13091)
* Migrate webhookCache from store/sqlstore/webhook_store.go to the new store/localcachelayer

* Remove duplicated statistics and move several functions to the layer

* Put cache size in format minutes * 60seconds

* Move cache functions to layer functions over the caches

* Directly remove and purge caches in handleClusterInvalidate to avoid loops
2019-11-25 20:44:52 +01:00
Martin Kraft
906f8dccef MM-19917: Removes use of unindexed Posts.EditAt field in compliance query. (#13078) 2019-11-22 08:12:41 -05:00
Rodrigo Villablanca Vásquez
3a8fb53f3e Migrates the lastPostsCache from PostStore into cache layer (#13141)
* Some advances

* Partial advances

* Cache moved

* Tests finished

* Removed all test for PostStore (store/sqlstore) related with Cache. This is tested in the cache layer now
2019-11-20 15:03:08 +01:00
Martin Kraft
0212845385 MM-18356: Adds ability to paginate channel search. (#12830)
* MM-18356: Adds ability to paginate channel search.

* MM-18356: Minor refactor.

* MM-18356: Adds doc.

* MM-18356: Fixes doc.

* MM-18356: Some commentary, adds the total count to non-paginated responses, and removes a stray fmt.

* MM-18356: Fixes shadowed variable.

* MM-18356: Removes paginate field and API parameter.

* MM-18356: Adds method to check if channel search is a paginated request.

* MM-18356: Vet fix.
2019-11-19 11:38:49 -05:00
Harrison Healey
de913e7537 Merge branch 'master' into mark-as-unread 2019-11-19 09:45:03 -05:00
larkox
c40f0a4aea [GH-13070] Migrate emojiIdCacheByName cache from store/sqlstore/emoji_store.go to the new store/localcachelayer (#13125)
Automatic Merge
2019-11-19 05:26:52 -05:00
catalintomai
1aca43d401 MM 17466 : Add custom post types to compliance exports (#13149)
Automatic Merge
2019-11-19 03:56:52 -05:00
larkox
2b52e1af0d [GH-13106] Migrate channelMemberCountsCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13128)
* Migrate channelMemberCountsCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer

* Move cache functions to layer functions over the caches

* Directly remove and purge caches in handleClusterInvalidate to avoid loops and prepare details for layer with multiple caches
2019-11-19 09:55:01 +01:00
Jesús Espino
7031f51b41 Deactivating and invalidating sessions of guest users on guest disable (#13007)
Automatic Merge
2019-11-15 09:43:52 -05:00
Carlos Tadeu Panato Junior
5ea8017db5 upgrade db to 5.17 (#13060)
Automatic Merge
2019-11-14 06:23:36 -05:00
Harrison Healey
df7cbcb440 Merge branch 'master' into mark-as-unread 2019-11-12 14:20:50 -05:00
Valentijn Nieman
36f3b14420 MM-19337 Enable users to view archived channels (#12995)
* First pass at searching archived channels

* Create endpoint for archived channels

* Update test for GetPublicChannelsForTeam

* Fix unit test for archived channels

* Rename includeDeleted to onlyDeleted

* Remove new /archived endpoint in favour of existing /deleted endpoint

* Fix broken test

* Remove manage team permission from /deleted endpoint

* Fix deletedChannels test

* Test for searching archived channels

* Only return private deleted channels user was a member of

* SearchArchivedChannels also searches private channels (user is a member of)

* Remove for loop to simplify append

* Remove userId from Client4 searcArchivedChannels
2019-11-12 06:15:19 +08:00
Jesús Espino
9557bcf329 Making private the sqlstore upgrade functions because nobody needs to call them from the outside (#13023) 2019-11-11 12:11:50 +00:00
Harrison Healey
6e6174a9ee Merge branch 'master' into mark-as-unread 2019-11-07 10:58:09 -05:00
Nikhil Ranjan
540cfb0239 Migrate tests from store/storetest/team_store.go to use testify (#12877)
* Migrate tests from store/storetest/team_store.go to use testify

* fix test

* fix varible declaration

* fix tests

* casting int64 to int for Equal check

* fix int64 int Equal check

* changes as per review
2019-11-07 20:01:32 +05:30
Nikhil Ranjan
ad1ab6b038 Migrate tests from "store/storetest/webhook_store.go" to use testify (#12736)
* change t.Fatal calls to use testify require

* fix already defined err

* changes as per review comments

* changes as per review

* err is not nil
2019-11-06 21:40:50 +01:00
Jesús Espino
8febdcf2b8 Removing unnecesary unnused old layered store (#12999) 2019-11-06 12:43:41 +01:00
Shobhit Gupta
a85c653f87 Migrate tests from "store/storetest/emoji_store.go" to use tes… (#12913) 2019-11-06 12:37:35 +01:00
Harrison Healey
47409aaa4b Merge branch 'master' into mark-as-unread 2019-11-04 15:04:28 -05:00
Witold Konior
159dec03a6 [MM-19355] Migrate tests from "store/storetest/user_store.go" (#12732)
* [MM-19355] Migrate tests from "store/storetest/user_store.go" to use testify

* fix error message

* make shadow happy!

* fix type casting in equal

* use assert instead of require to soft fail for email updates
2019-11-04 08:50:17 -05:00
Gervasio Marchand
1db045bce3 MM-16822 - Implement KVSetWithOptions (#11818)
* Add SetWithOptions

* Avoid passing two structs to the functions

* Rename ExpiryInSeconds -> ExpireInSeconds

* Use t.Run for the tests

* Fix build

* Address feedback

* Update log message

* Update docs and use KVSetWithOptions in KVCompareAndSetJSON

* Improve code style

* Use struct instead of pointer to struct

* Fix minimum server versions

* Update documentation

* Address feedback

* Revert new implemention of kv helpers

* Adress feedback
2019-11-04 13:49:54 +01:00
Ben Schumacher
812c40a307 Adjust govet settings and fix issues found by it (#12947) 2019-11-04 13:47:59 +01:00
Ben Schumacher
a2adf7b3f5 Run unused against codebase (#12968)
* Remove unused methods

* Fix missed issues
2019-11-01 23:08:01 +01:00
Nikhil Ranjan
3687a0b6c1 Migrate tests from store/storetest/status_store.go to use test… (#12873) 2019-11-01 12:52:18 +01:00
catalintomai
7c658a98f0 MM-18060: Include deleted posts in compliance export. (#12957) 2019-10-31 09:31:18 -07:00
Harrison Healey
fa34be4aa0 Merge branch 'master' into mark-as-unread 2019-10-31 09:15:41 -04:00
Nikhil Ranjan
a221c52acb Migrate tests from store/storetest/oauth_store.go to use testify (#12875) 2019-10-30 19:37:36 +01:00
Carlos Tadeu Panato Junior
b3c0b5dd57 remove redis (#12918) 2019-10-29 15:05:54 +00:00
Akshay Chhajed
91f944f64d Migrate tests for store/storetest/channel_store.go (#12892)
* Migrate tests for store/storetest/channel_store.go

* Corrected variable declaration

* corrected nilf to nil

* Reordered parameters to Equal and EqualValues
Corrected few tests to use Len, NotNil to improve readability

* Removed third parameter from require.Nil()

* Corrected failing tests
2019-10-29 07:43:23 -07:00
Harrison Healey
eb36329e8d Merge branch 'master' into mark-as-unread 2019-10-29 10:11:41 -04:00
Ben Schumacher
38c0bde7f8 Run ineffassign against codebase (#12925) 2019-10-29 15:04:28 +01:00
Ben Schumacher
7a665aacdd Run gosimple against codebase (#12928) 2019-10-29 07:45:09 +01:00
Nikhil Ranjan
d7649fbf31 Migrate tests from store/storetest/terms_of_service_store.go to use testify (#12874) 2019-10-28 20:02:28 -04:00
Nikhil Ranjan
7bcb835f37 Convert store/storetest/preference_store.go t.Fatal calls into assert/require calls (#12800)
* Convert store/storetest/preference_store.go t.Fatal calls into assert/require calls

* fix test
2019-10-28 17:23:55 -04:00
Ben Schumacher
fdcda20fe4 Cleanup dead code (#12929)
* Cleanup dead code

* Remove unneeded translation string
2019-10-28 19:12:50 +01:00