Commit Graph

723 Commits

Author SHA1 Message Date
Jesse Hallam
918307e4fa delete kv on setting nil (#13769)
Setting a `nil` value should actually delete the row instead of preserve it with a `nil` value.

The existing tests passed because they only checked the return value of `nil`. When running the tests on Postgres, this value is returned as an empty `[]byte{}` instead of `nil`, so update the test to reflect this semantically equivalent behaviour.
2020-01-31 09:58:48 -04:00
Jesús Espino
d66a2f90c6 Removing unused param and unneeded query (#13792) 2020-01-30 16:12:37 +01:00
Farhan Munshi
afa35ac575 [MM-21946] [MM-21945] Ensure deleted groups are not returned from the groups API (#13747)
* MM-21946 Ensure deleted groups are not returned from the groups API

* MM-21946 Only append to query at the end

* MM-21946 Add DeleteAt check to the top of the GetGroups function and clean up the formatting a bit

* MM-21946 Move the From statement into the next block
2020-01-27 11:45:14 -05:00
Jesús Espino
c3ad342c5e Fix GetMembers store methods order, which wasn't working properly in postgres (#13754) 2020-01-27 15:49:51 +01:00
Martin Kraft
50e9aa01c3 MM-21157: Triggers role sync when a syncable is linked, unlinked, or updated. (#13432)
* MM-20644: Add users to teams as a SchemeAdmin based on a new configuration field on GroupTeams and GroupChannels records.

* MM-20644: Adds SchemeAdmin to mapping of the GroupSyncable struct fields.

* MM-2064: Adds test to ensure SchemeAdmin field value is mapped.

* MM-20644: Adds missing index creation for fresh DBs.

* MM-20644: Duplicates UpdateMembersRole across Team and Channel stores. Adds tests.

* MM-20644: Fixes some old method name references.

* MM-20644: Moves variable declaration; removes Println statement.

* MM-21157: Triggers role sync when a syncable is linked, unlinked, or updated.

* MM-20644: Use a SQL query instead of two to update Team and Channel members.

* MM-20644: Fixes tests; updates query.

* MM-21157: Removes second invocation of function because of refactor that performs it all in a single query.

* MM-21157: Switches a few queries to Squirrel.

* MM-21157: SQL-formats some strings.

* MM-21157: Select with list.

* MM-21157: Converts some more sql to squirrel.

* MM-21157: Fix incorrect conflict resolutions.

* MM-21157: Fix incorrect conflict resolutions.

* MM-21157: Adds missing mocks.

* MM-21157: Clears cache upon syncing roles.

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-20 09:10:25 -05:00
Jesse Hallam
6d79484e55 MM-21645: COALESCE(Bots.LastIconUpdate, 0) (#13638)
Handle a potentially `NULL` Bots.LastIconUpdate and `COALESCE` back to `0`. This column has no default, and while v5.20 should never write it as `NULL`, any pre-v5.20 server writing to the new schema will. As a result, this change ensures backwards compatibility.

Fixes: https://mattermost.atlassian.net/browse/MM-21645
Fixes: https://mattermost.atlassian.net/browse/MM-21585
2020-01-17 17:16:18 -04:00
Jesse Hallam
4314a0427f MM-21328: Fix KVCompareAndSet when new==old (#13612)
`KVCompareAndSet(key, sameValue, sameValue)` can fail spuriously on MySQL if the underlying `UPDATE` requires no actual changes. As per the [MySQL documentation](https://dev.mysql.com/doc/refman/8.0/en/mysql-affected-rows.html), we can't rely on rows affected in this case:

> For UPDATE statements, the affected-rows value by default is the number of rows actually changed. If you specify the CLIENT_FOUND_ROWS flag to mysql_real_connect() when connecting to mysqld, the affected-rows value is the number of rows “found”; that is, matched by the WHERE clause.

It's not tenable to change `CLIENT_FOUND_ROWS` for the all connection, so handle this case in the code instead by running a `SELECT` after the fact. Note that `KVCompareAndSet` has no guarantee of atomicity in this case, but neither would `CompareAndSwap` on which this is method was inspired.

Finally, note that no changes are required for Postgres, which has sane semantics as the default.

Fixes: https://mattermost.atlassian.net/browse/MM-21328

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-16 15:29:10 -04:00
Eli Yukelzon
8e0fe90897 Thread fetching revert (#13616)
* Revert "MM-19371 - Reply count disappears from pinned and flagged conv… (#12753)"
2020-01-15 17:14:04 +02:00
Patryk Pomykalski
5f7ca55b13 MM-21520: Remove temporary databases after tests run (#13572)
* MM-21520: Remove temorary databases after tests run

* accidental test name change

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-13 16:54:07 +01:00
larkox
d4935fb22f [GH-13073] Migrate profilesInChannelCache cache from store/sqlstore/user_store.go to the new store/localcachelayer (#13536)
* Migrate profilesInChannelCache cache from store/sqlstore/user_store.go to the new store/localcachelayer

* Fix lint errors

* Remove unneeded cluster messages

* Remove unneeded cluster message registering

* Fix cluster messages

* Correct mistake with messages and restore model message
2020-01-11 17:52:44 +01:00
Martin Kraft
605040c597 MM-20644: Add users to teams as a SchemeAdmin based on a new configuration field on GroupTeams and GroupChannels records. (#13361)
* MM-20644: Add users to teams as a SchemeAdmin based on a new configuration field on GroupTeams and GroupChannels records.

* MM-20644: Adds SchemeAdmin to mapping of the GroupSyncable struct fields.

* MM-2064: Adds test to ensure SchemeAdmin field value is mapped.

* MM-20644: Adds missing index creation for fresh DBs.

* MM-20644: Duplicates UpdateMembersRole across Team and Channel stores. Adds tests.

* MM-20644: Fixes some old method name references.

* MM-20644: Moves variable declaration; removes Println statement.

* MM-20644: Use a SQL query instead of two to update Team and Channel members.

* MM-20644: Fixes tests; updates query.

* MM-20644: Fix permission check for patching a group syncable.

* MM-20644: Fixes test for change of permissions verification in group patch API request.

* MM-20644: Fix for ORM select vs insert.

* MM-20644: Linting fixes.

* MM-20644: Fixes some tests.

* MM-20644: Skips changing the role of guests.

* MM-20644: Added syncableID filtering
2020-01-10 09:19:39 -08:00
Patryk Pomykalski
c41e9d970a Optimize queries and indexes on posts table (#13217)
* Optimize queries and indexes on posts table

Added RootId column to two indexes. Query in getParentPosts split into
two queries - for big channels can be ~1000x times faster in MySQL, but
a bit slower in PostgreSQL.
Rewritten query in GetPostsSince for MySQL - around 20% faster.
Benchmark results (/1 - 140k posts in channel, /2 - 800 posts):

benchmark                                                         old ns/op      new ns/op     delta
BenchmarkPosts/postgres/GetFlaggedPostsForTeam/1-16               12068006       12130615      +0.52%
BenchmarkPosts/postgres/GetFlaggedPostsForChannel/1-16            7334992        7388359       +0.73%
BenchmarkPosts/postgres/GetPosts(skipThreads=true)/1-16           1845547        1979362       +7.25%
BenchmarkPosts/postgres/GetPosts(skipThreads=false)/1-16          2260061        2595112       +14.82%
BenchmarkPosts/postgres/GetPostsSince(skipThreads=true)/1-16      38510212       40625368      +5.49%
BenchmarkPosts/postgres/GetPostsSince(skipThreads=false)/1-16     32389821       32581044      +0.59%
BenchmarkPosts/postgres/GetFlaggedPostsForTeam/2-16               1604215        1584941       -1.20%
BenchmarkPosts/postgres/GetFlaggedPostsForChannel/2-16            1278623        1277473       -0.09%
BenchmarkPosts/postgres/GetPosts(skipThreads=true)/2-16           1921049        1984581       +3.31%
BenchmarkPosts/postgres/GetPosts(skipThreads=false)/2-16          3478147        3000086       -13.74%
BenchmarkPosts/postgres/GetPostsSince(skipThreads=true)/2-16      4813332        5198276       +8.00%
BenchmarkPosts/postgres/GetPostsSince(skipThreads=false)/2-16     3475847        3816201       +9.79%
BenchmarkPosts/mysql/GetFlaggedPostsForTeam/1-16                  9674132        9708361       +0.35%
BenchmarkPosts/mysql/GetFlaggedPostsForChannel/1-16               5780763        5818874       +0.66%
BenchmarkPosts/mysql/GetPosts(skipThreads=true)/1-16              2261194        2268826       +0.34%
BenchmarkPosts/mysql/GetPosts(skipThreads=false)/1-16             2371804023     3184120       -99.87%
BenchmarkPosts/mysql/GetPostsSince(skipThreads=true)/1-16         35552813       27709811      -22.06%
BenchmarkPosts/mysql/GetPostsSince(skipThreads=false)/1-16        28758400       22622865      -21.33%
BenchmarkPosts/mysql/GetFlaggedPostsForTeam/2-16                  1174064        1205933       +2.71%
BenchmarkPosts/mysql/GetFlaggedPostsForChannel/2-16               1007026        1091551       +8.39%
BenchmarkPosts/mysql/GetPosts(skipThreads=true)/2-16              2274397        2408730       +5.91%
BenchmarkPosts/mysql/GetPosts(skipThreads=false)/2-16             7454395        2542741       -65.89%
BenchmarkPosts/mysql/GetPostsSince(skipThreads=true)/2-16         8879200        6843435       -22.93%
BenchmarkPosts/mysql/GetPostsSince(skipThreads=false)/2-16        6293932        5373276       -14.63%

* old version of getParentsPosts for PostgreSQL

because new version using two queries is around 15% slower.

* review fixes

* revert index changes
2020-01-10 10:26:44 +05:30
Agniva De Sarker
d938d70dcd MM-21211: Optimize Channelstore.UpdateLastViewedAt (#13529)
* MM-21211: Optimize Channelstore.UpdateLastViewedAt

For postgres, we use CTEs to do both queries at one
and return the data.

For mysql, CTEs aren't available until version 8. So we just optimize the
existing query.

- We use IN instead of multiple OR conditions for the channel membership check.
According to mysql https://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#operator_in:

If no type conversion is needed for the values in the IN() list,
they are all constants of the same type, and expr can be compared to each of them
as a value of the same type (possibly after type conversion), an optimization takes place.

The values the list are sorted and the search for expr is done using a binary search,
which makes the IN() operation very quick.

- We use the previous column LastViewedAt to replace the value of LastUpdateAt
instead of doing a switch case again.

https://dev.mysql.com/doc/refman/5.6/en/ansi-diff-update.html

If you access a column from the table to be updated in an expression, UPDATE uses the
current value of the column.

Results (ran with getchannel profile):

Postgres:
| Metric | Baseline | Actual | Delta | Delta % |
| --- | --- | --- | --- | --- |
| Hits | 1594 | 1574 | -20 | -1.25%
| Error Rate | 0.00% | 0.00% | 0% | 0% |
| Mean Response Time | 7.08ms | 6.36ms | -0.72ms | -10.20% |
| Median Response Time | 5.00ms | 4.00ms | -1.00ms | -20.00% |
| 95th Percentile | 9.00ms | 8.00ms | -1.00ms | -11.11% |

Mysql:
| Metric | Baseline | Actual | Delta | Delta % |
| --- | --- | --- | --- | --- |
| Hits | 1600 | 1566 | -34 | -2.12%
| Error Rate | 0.00% | 0.00% | 0% | 0% |
| Mean Response Time | 7.39ms | 7.02ms | -0.37ms | -4.94% |
| Median Response Time | 6.00ms | 6.00ms | 0ms | 0% |
| 95th Percentile | 10.00ms | 10.00ms | 0ms | 0% |

* Add comment on using CTEs for mysql8

* incorporate review comments

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-09 22:04:30 +05:30
Agniva De Sarker
2dba5dbf86 MM-21368: Optimize MapStringsToQueryParams (#13601)
- Use strings.Builder which minimizes allocations.
- Avoid fmt.Sprintf which is slower than simple string concat.

Results:

name                                      old time/op    new time/op    delta
MapStringsToQueryParams/one_item-8           512ns ± 2%     377ns ± 1%  -26.27%  (p=0.000 n=10+9)
MapStringsToQueryParams/multiple_items-8     858ns ± 5%     748ns ± 2%  -12.82%  (p=0.000 n=10+9)

name                                      old alloc/op   new alloc/op   delta
MapStringsToQueryParams/one_item-8            456B ± 0%      384B ± 0%  -15.79%  (p=0.000 n=10+9)
MapStringsToQueryParams/multiple_items-8      608B ± 0%      592B ± 0%   -2.63%  (p=0.000 n=10+10)

name                                      old allocs/op  new allocs/op  delta
MapStringsToQueryParams/one_item-8            8.00 ± 0%      6.00 ± 0%  -25.00%  (p=0.000 n=10+10)
MapStringsToQueryParams/multiple_items-8      12.0 ± 0%      12.0 ± 0%     ~     (all equal)
2020-01-09 07:44:01 -08:00
Hector
62b57143c8 [MM 19840] Create a Cache Interface abstraction to support multiple cache backends (#13384)
* Refactor to use structured logging

* Properly formatted with gofmt

* created interface Cache, but construction of cache is still coupled.

* Implementing cache factories to build caches

* Simple redis implementation without error handling. Keys and values by default are string

* refactor NewLocalCacheLayer to inject cache factory

* Removed redis impl to focus on cache abstraction

* CacheFactory injected on sqlsupplier and saved in Store struct

* remove useless private method

* replace concrete declaration of lru cache to cache abstraction

* discard spaces

* Renamed factory to provider because concrete implementations of factories may hold an state (such as a redis client for example)

* refactor to include all caches in the same package cache and subpackages

* method close cache. This method will be used for concrete implementations that need to release resources (close a connection, etc)

* closing cacheprovider and releasing resources while closing sql store

* fixed merge conflict fail

* gofmt files

* remove unused property from post_store

* naming refactor to avoid stutter. Added godocs on interface

* Store doesnt know anything about the cache and provider. Cache provider will be built after loading config and injected in localCacheLayer

* fixed broken test

* cache provider initialized before RunOldAppInitialization which initializes the localcachelayer

* move statusCache to server to initialize it with the new cache provider

* update terms_service and channel_layer to have new cacheProvider

* gofmt

* Add Connect method to the cache provider

* mock cacheprovider in user_layer_test

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-09 09:57:28 +01:00
Jesús Espino
464c290e50 Removing certain unneded cluster invalidation messages (#13549)
* Removing certain unneded cluster invalidation messages

* Fixing typo

* Removing channges included in other PR

* Adding doc string to RegisterAllClusterMessageHandlers method

* fixing typos

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-01-08 11:31:10 +01:00
Jesús Espino
092e53ace2 Fix inconsistencies in variable names for struct methods (#13561) 2020-01-07 10:47:03 +01:00
Joram Wilander
23eebcf0d7 Fix Bots table lacking schema migration (#13542) 2019-12-30 09:33:27 -08:00
Renil Joseph
803a58f991 [MM-17422] Added code to update, delete last bot_icon time in model.bot. (#12229)
Display LHS bot Icon in web app. As part of mentioned task, Added LastIconUpdate variable in model.bot to store last update time of icon. Also added code to update/delete value of the mentioned variable when setting/deleting bot icon.
2019-12-29 15:30:18 +01:00
Claudio Costa
9ab7bee0a6 Return http.StatusNotFound error when trying to get a channel by name without permissions (#13443) 2019-12-23 21:46:52 +01:00
Jesús Espino
b3e49ec45c Use require/assert.Empty instead of require/assert.Len(t, X, 0) (#13413) 2019-12-22 12:35:31 +01:00
catalintomai
e48d093d01 MM-19877: Remove references to PermanentDeleteBatch from audit store (#13393)
* MM-19877: Remove references to PermanentDeleteBatch from audit store
2019-12-20 15:37:01 +00:00
Sanele T. Mahlalela
de9a0197e2 [GH-13074] Migrate TermsOfServiceCache from store/sqlstore/terms_of_service.go to the new store/localcachelayer (#13205)
* migrated termsOfServiceCache from sqlstore to localcachelayer, and mocked store tests

* revert gitignore local change

* fixed caching in termsOfService Get, and added basic tests for termsOfServiceCache

* added a test for cache save, and fixed call to Store tests

* fixed GeLatest termsOfService from cache test

* added license headers to terms_of_service cache files

* using doStandardReadFromCache and doStandardAddToCache when reading and writing to cache

* removed unused variable, termsOfServiceCacheName

* added special key for the latest termsOfService value in termsOfServiceCache

* updated license information on localcachelayer termsOfServiceCache files

* fixed not updating latest termsOfServiceCache on Get by ID, and invalidating cache cluster on termsOfServiceCache save

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2019-12-20 13:51:54 +01:00
Agniva De Sarker
c9cd14b50b MM-21331: Add aggregate cache metrics for channelByNameCache (#13440)
The `channelByNameCache` in the `GetByNames` query checks each teamId+channelName
combination in the cache and if any of the keys is not present, it queries the DB.

In this case, this is effectively a cache miss from the point of view of user.
But since the cache is at a teamId+channelName level, there may be several hits and some misses.
This is misleading as it does not generate proper metrics and might lead to a
false assumption of how effective the cache is.

We create separate metrics which account for all or none cache hits/misses.
This removes the old metrics which are used by other queries. So they are now separated,
and it will improve both the old and new metric. Because the old metric is not contaminated,
and the new metric is also separate.
2019-12-20 17:04:19 +05:30
Vladimir Lebedev
e4481aae21 MM-20104 -Migrate channelCache cache from store/sqlstore/channel_store.go to th… (#13254)
* Migrate channelCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer

* fix import for new path

* remove unnecessary code, refactor cache constant

* resolve conflicts

* fix missing variable and import after merging

* refactor code, fix current issue

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2019-12-20 13:34:58 +05:30
Claudio Costa
7274f4c6c2 [MM-21020] Return same error when creating a duplicate channel (#13429)
* Return same error when trying to create a channel with the same name of an existing one

* Remove unused arguments
2019-12-19 18:50:20 +01:00
Martin Kraft
75ffd0b69e MM-14675: Eliminates implicit GroupChannel/GroupTeam associations. (#13199)
* MM-14675: Upserts GroupTeam when GroupChannel is linked.
MM-14675: Delete all associated GroupChannels when deleting a GroupTeam.
MM-14675: Using replica DB where possible.
MM-14675: Updates create method used in tests.

* MM-14675: Removes unnecessary DB retrieval of GroupSyncable record.
2019-12-18 08:54:09 -05:00
Agniva De Sarker
0e6f0cfbd6 MM-21118: Use querybuilder instead of fmt.Sprintf in channelStore (#13385)
* MM-21118: Use querybuilder instead of fmt.Sprintf in channelStore

We use the querybuilder API instead of just building the query string
manually using fmt.Sprintf

* Replaced comma with colon
2019-12-17 18:03:38 +01:00
Hossein Ahmadian-Yazdi
de0672937c [MM-19422] Add SQL trace and LDAP trace output to both console and server logs (#13190)
* Add MLOG for sql store

* Update printf function

* Update store/sqlstore/supplier.go

Co-Authored-By: Martin Kraft <martin@upspin.org>

* Update go mod

* update go mod and tidy it up

* update vendor folder
2019-12-17 09:47:09 -05:00
Jesús Espino
b8ef62e502 Adding structuredLogging check and fix inconsistencies (#13370)
* Adding structuredLogging check and fix inconsistencies

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments

* Addressing PR review comments
2019-12-16 13:57:21 +01:00
Agniva De Sarker
7d499d2750 MM-21116: Improve channelSearch SQL query generation (#13371)
* MM-21116: Improve channelSearch SQL query generation

The likeTerm from buildFulltextClause was being built inefficient using strings.
We change it to use squirrel to build the query.

And while at it, we also change the len check with checking with
an empty string which is more idiomatic. Both compile to the same
code, so there is no difference performance wise.

* Use a better variable name
2019-12-12 23:13:33 +05:30
larkox
d8f5b2a4da [GH-13099] Migrate lastPostTimeCache cache from store/sqlstore/post_store.go to the new store/localcachelayer (#13134)
Automatic Merge
2019-12-11 06:42:00 -05:00
Carlos Tadeu Panato Junior
d3a1a37f93 upgrade DB to 5.18 (#13315) 2019-12-05 23:06:50 +01:00
Ali Farooq
186524bba4 Revert "MM-20105: Migrate channelByNameCache cache from store/sqlstore/channel_store.go to the new store/localcachelayer (#13189)" (#13329)
Automatic Merge
2019-12-05 16:15:07 -05:00
Christopher Poile
6e6a44764c [MM-19892] Fix failing test TestImportBulkImport (#13003)
Automatic Merge
2019-12-04 11:31:52 -05:00
Claudio Costa
72f3bb10c7 [MM-20761] Fix and improve integrity check tool (#13246)
* Fix query and add tests

* Support NULL values and improve output
2019-12-04 16:56:08 +01:00
Igor Gomonov
dc610d201d GH-12781: Migrate tests to use testify (#13203) 2019-12-04 16:49:06 +01:00
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
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
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