Commit Graph

1156 Commits

Author SHA1 Message Date
Keaton Neville
1640702d5e GH-11550 Migrate "Team.ResetAllTeamSchemes" to Sync by default (#11564)
* Refactor as per #11550

* Remove trailing semicolon
2019-07-08 18:01:39 -03:00
Mounica Paladugu
eddf48c848 [MM-16166] Migrate Team.GetAllPrivateTeamListing to Sync by default (#11103)
* [MM-16166] Migrate Team.GetAllPrivateTeamListing to Sync by default

* Simplifying code
2019-07-08 21:30:52 +02:00
Max Vovshin
bed9102eb1 Team.GetTeamsByScheme migrated to sync by default. (#11563) 2019-07-08 21:30:32 +02:00
Alexander Redinger
15c3c5f9e6 Migrate User.Save to Sync by default (#11482)
* Migrate User.Save to Sync by default

* Make error testing more explicit

* Factor out else

* Fix some merge-related bugs

* Add some missing nil err test requirements

* Improve function signature

* Remove unused time import

* More test fixups
2019-07-08 15:19:21 -04:00
Alejandro Sánchez Medina
d15c2c4e69 Migrate "Team.RemoveAllMembersByUser" to Sync by default (#11560)
* Migrate "Team.RemoveAllMembersByUser" to Sync by default

* fixing merge problem
2019-07-08 20:31:18 +02:00
Alejandro Sánchez Medina
2149e3dd2f [MM-16574] Migrate "User.GetEtagForProfilesNotInTeam" to Sync by default (#11518)
* [MM-16574] Migrate "User.GetEtagForProfilesNotInTeam" to Sync by default

* Update "GetEtagForProfilesNotInTeam" interface
2019-07-08 20:16:40 +02:00
Luke P
2e48b6ef3f [MM-16653] Migrate "User.UpdateUpdateAt" to Sync by default (#11517)
* Migrate "User.UpdateUpdateAt" to Sync by default

* Fixed errors in app/team.go that prevented successful build

* Reverted some changes in user_store test that caused errors in pipeline

* return of UpdateUpdateAt changed to model.AppError

* Ensured that UpdateUpdateAt in sqlstore/user_store.go returns int64 and *model.AppError, adjusted tests accordingly

* Generated mocks and ensured storetest/user_store.go had no errors

* Added require.Nil(t, err) to proper places in tests

* Added 'err' for second return value as opposed to _ in 4 UpdateUpdateAt() occurrences in storetest/user_store.go
2019-07-08 20:14:40 +02:00
Guillermo Vayá
797d1dc40f [MM-16784] Sync GetUserTeamIds (#11579)
* [MM-16784] Sync GetUserTeamIds

* fix format

* [MM-16784] put error in one line

* [MM-16784] Remove docstring as per CR request

* [MM-16784] Revert "Remove docstring as per CR request"

This reverts commit 8a64d3841b.
2019-07-08 20:10:25 +02:00
Taufiq Rahman
eb4c97c3e8 [MM-16315] Migrate Channel.PermanentDelete to Sync by default (#11485)
* [MM-16315] Migrate Channel.PermanentDelete to Sync by default

* fix migration at app/channel.go
2019-07-08 11:46:30 -05:00
Phillip Ahereza
ff5b221598 Migrate Plugin.List to Sync by default (#11582) 2019-07-08 23:35:33 +08:00
George Goldberg
efc342f294 MM-16625: Set UpdateAt correctly on deleting profile pic. (#11525) 2019-07-08 11:16:32 -04:00
Phillip Ahereza
17b49e4538 [MM-16790] Migrate Plugin.Get to Sync by default (#11581)
* Migrate Plugin.Get to Sync by default

* remove unnecessary else branch

* remove unnecesary blank line
2019-07-08 13:13:10 +02:00
Max Vovshin
956c8930f5 GetAllForExportAfter migrated to sync by default. (#11562) 2019-07-08 09:10:09 +01:00
George Goldberg
f08f7f77c3 MM-16759: Fix flaky group-store test. (#11527) 2019-07-08 07:55:46 +01:00
Rodrigo Villablanca Vásquez
e908165fe3 Migrate User.InferSystemInstallDate to sync by default (#11505)
* Migrate User.InferSystemInstallDate to sync by default

* Change var name
2019-07-08 07:46:31 +01:00
Alejandro Sánchez Medina
7663c5b00e Migrate "Team.UpdateLastTeamIconUpdate" to Sync by default (#11561) 2019-07-07 14:55:17 -05:00
Rodrigo Villablanca Vásquez
4380c0b7a8 Migrate User.ClearAllCustomRoleAssignments to sync by default (#11506) 2019-07-07 19:50:18 +02: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
Max Vovshin
0b90888e73 Team.GetTeamMembersForExport migration to Sync by default. (#11559) 2019-07-07 12:13:43 +02:00
Jesús Espino
96c33948da Migrate SchemeStore to sync by default (#11522)
* Migrate SchemeStore to sync by default

* Fixing tests compilation

* Fixing shadow variable

* Fixing tests
2019-07-06 09:07:54 +02:00
Rodrigo Villablanca Vásquez
7da08e7a0f Migrate User.UpdateFailedPasswordAttempts to sync by default (#11507)
* Migrate User.UpdateFailedPasswordAttempts to sync by default

* Removed unused return value
2019-07-06 09:05:44 +02:00
Jesse Hallam
0d05fe32af MM-16796: reduce plugin job interval to once per day (#11521)
* MM-16796: reduce plugin job interval to once per day

The Jobs infrastructure isn't currently setup for running frequent jobs,
as it spams the Jobs table with useless records. Update the plugin job
interval to run less frequently -- since the cleanup doesn't affect
semantics anyway -- and clean up the previously created entries in the Jobs table.
2019-07-05 20:11:11 -03:00
Phillip Ahereza
c34942afec Migrate "User.GetProfilesByUsernames" to Sync by default (#11523)
* changed GetProfilesByUsernames signature

* modified the UserStore interface to reflect changed made to the GetProfilesByUsernames function signature

* modify usages of GetProfilesByUsernames

* fix gofmt

* fixed failing userstore tests
2019-07-05 15:19:40 -04:00
Rodrigo Villablanca Vásquez
aa14c9bbdb Migrate User.GetProfiles to sync by default (#11512) 2019-07-05 19:57:01 +02:00
Rodrigo Villablanca Vásquez
11f1accac6 11460 user.get all profiles in channel (#11515) 2019-07-05 16:18:45 +02:00
Adzim Zul Fahmi
8dfd3bab20 make user.Get all return []*model.User and *model.AppError (#11516)
run mock generate
2019-07-05 09:39:14 -04:00
Marc Argent
2f9d509284 GH-11469 Migrate User.UpdateLastPictureUpdate to Sync by default (#11493)
* GH-11469 Migrate User.UpdateLastPictureUpdate to Sync by default

* GH-11469 log error on failure
2019-07-04 14:59:10 +02:00
Rodrigo Villablanca Vásquez
cf695095d8 Migrate User.GetEtagForAllProfiles to sync by default (#11509) 2019-07-04 14:30:23 +02:00
Rodrigo Villablanca Vásquez
9839b46889 Migrate User.GetAllProfiles to sync by default (#11513) 2019-07-04 14:14:34 +02:00
Rodrigo Villablanca Vásquez
b738e02c15 Migrate User.GetProfileByIds to sync by default (#11510) 2019-07-04 11:57:12 +02:00
Rodrigo Villablanca Vásquez
c0c93a1b09 Migrate User.GetEtagForProfiles to sync by default (#11508) 2019-07-04 10:05:27 +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
Phillip Ahereza
df869e3f86 SyncStore: Migrate User.GetForLogin method to Sync (#11501) 2019-07-03 11:12:33 -04:00
Alex Sahin
f8c9f881c9 migrated to sync by default (#11488) 2019-07-03 09:05:09 -04:00
Micah Thompson
7180002df8 [MM-16522] Migrate "Status.UpdateLastActivityAt" to Sync by default (#11444)
* [MM-16522] Migrate "Status.UpdateLastActivityAt" to Sync by default

* Remove unused import
2019-07-03 08:35:39 -04:00
Adzim Zul Fahmi
37b726b651 Migrate "User.AnalyticsActiveCount" to Sync by default (#11419)
* migrate User.AnalyticActiveCount to sync default

* fixing shadowing variable err

* fixing shadowing variable err

* run query in async

* migrate app/diagnostic to explicit async

* remove error logging
2019-07-03 13:16:26 +02:00
jfrerich
95652da0b8 [MM-14720] Add Posts Per Day Analytics and Number Posts Previous Day Functionality (#11402)
* Add ability to get bot counts per day

Modify tests using AnalyticsPostCountsByDay to include extra input
(botsOnly)

Correctly generate the mock file with 'make store-mocks' target.  Didn't
see these comments earlier

* Initial commit for calculating total posts previous day and total posts
from bots previous day

* - Refactor to use asserts instead of if statements in tests
- Capture inputs to AnalyticsPostCountsByDay() function into an
  options struct
- Remove bot creation from diagnostics_test.go.

* Remove utils library

* create AnalyticsPostCountsOptions struct which is accepted as an input
to AnalyticsPostCountsByDay method

* Go vet fixes
2019-07-02 14:10:22 -07:00
ollykel
c8fb1b6265 Migrated TokenStore.RemoveAllTokensByType to Sync by default (#11345) (#11358)
* [MM-11345] Migrated TokenStore.RemoveAllTokensByType to Sync by default (#11345)

* changed TokenStore.RemoveAllTokensByType to return *model.AppError

* changed test coverage accordingly in store/storetest/mocks

* Fixing mocks
2019-07-02 22:41:17 +02:00
Shobhit Gupta
b138d4b8c4 Migrate Emoji.GetMultipleByName to Sync by default (#11315)
* Migrate Emoji.GetMultipleByName to Sync by default

* Fix indentation

* Fixing mocks
2019-07-02 22:26:08 +02:00
Marc Argent
b55b9a3d97 GH-11465 Migrate User.UpdateMfaSecret to Sync by default (#11496)
* GH-11465 Migrate User.UpdateMfaSecret to Sync by default

* GH-11465 make mfa call async

* GH-11465 return *model.AppError directly
2019-07-02 16:22:24 -04:00
Shobhit Gupta
eea8df75b0 Migrate Channel.GetChannelsByScheme to Sync by default (#11278) 2019-07-02 22:06:03 +02:00
Taufiq Rahman
d1a594e504 Migrate Channel.PermanentDeleteByTeam to Sync by default #11175 (#11473) 2019-07-02 21:33:27 +02:00
piperRyan
45b47ca901 Migrate "User.GetSystemAdminProfiles" to Sync by default (#11491) 2019-07-02 19:16:14 +02:00
Alexander Redinger
0b6e4e2f16 Migrate 'User.GetProfilesNotInTeam' to Sync by default (#11420) 2019-07-02 17:57:53 +02:00
Jesús Espino
bcaab359a4 Migrating more GroupStore methods to sync by default (#11447)
* Migrating more GroupStore methods to sync by default

* Fixing tests

* Fixing tests

* Fixing compilation
2019-07-02 17:18:04 +02:00
Jesús Espino
76ac7d8ef0 Migrate TermsOfService and UserTermsOfService stores to sync by default (#11282) 2019-07-02 16:22:20 +02:00
Jesús Espino
1050aacb42 Migrating some GroupStore methods to sync by default (#11445)
* Migrating some GroupStore methods to sync by default

* Fixing shadow variables
2019-07-02 15:50:22 +02:00
SezalAgrawal
f881b00650 [MM-16572] Migrate "User.AnalyticsGetSystemAdminCount" to Sync by default (#11484) 2019-07-02 11:21:37 +02:00
Guillermo Vayá
b664291f21 [Mm-7854] [Backend] Add an endpoint to revoke sessions from all users (#11200)
* first steps towards revoke all sessions endpoint

* route added

* change permission into a more restrictive one

* fix url

* add store code

* testing & mocking

* fixing what merge broke

* remove sessions without retrieving them

* flush sessions from cache

* stop going through sessions to revoke caches, not needed anymore

* add test, fix func name

* fix tests

* remove unneeded code

* [MM-7854]remove access tokens, move to users

* fix docstring

* [MM-7854] improve readability by using require

* [MM-7854] fix tests

* [MM-7854]fix comment

* [MM-7854]improve testing logic
2019-07-01 22:28:46 +01:00
Micah Thompson
0d5020e566 [MM-16652] Migrate "User.ResetLastPictureUpdate" to Sync by default (#11474)
* [MM-16652] Migrate "User.ResetLastPictureUpdate" to Sync by default

* [Suggested Changes] Added mlog for error and removed return of userid
2019-07-01 22:07:59 +02:00