Commit Graph

1233 Commits

Author SHA1 Message Date
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
Rodrigo Villablanca Vásquez
cff942f5bf Migrates Channel.GetMembersForUserWithPagination to sync by default (#11232)
* Migrates Channel.AutocompleteInTeam, Channel.SearchInTeam and Channel.SearchMore to sync by default

* Migrates Channel.GetMembersForUserWithPagination to sync by default
2019-07-01 11:19:44 -04:00
Luke P
d0906a0c85 [MM-16517] Migrate "Status.Get" to Sync by default (#11367)
* Test

* Revert "Test"

This reverts commit 2bbf335ee9.

* Fixed typo in Makefile, line 564: 'persistent' misspelled

* Fixed return of status_store.Get to return model.Status and model.AppError, removed connections to result var in same method, generated new mocks and fixed tests.

* Fixed status_store.go under /sqlstore and /storetest in addition to removing personal comments

* SQL Indentation fix for consistency

* Revert merge change to store.go for SaveOrUpdate to avoid error introduced by merge

* Changed StoreChannel back to *model.Apperror for SaveOrUpdate in store.go, fixed resulting error in storetest/status_store.go so it did not have conflicting types. Fixed spelling errors in same file

* Test for status, err changed according to recommendation upon second look

* Changed status variable on line 77 to blank identifier to stop it from shadowing line 24 declaration

* It appears last statement in test was using 'status' variable where status is model.STATUS_ONLINE instead of model.STATUS_OFFLINE like status3, making comparison always be 'online != offline', which is always true, proceeding into if statement, guaranteeing test failure

* Build fails consistently when line 75 has 'status' in if statement due to shadowing issue due to existing declaration Jenkins complains about in line 24. If this fails then new variable will be necessary

* Renamed parameter to avoid overshadowing issue

* Undid code addition mistake in storetest/status_store.go and updated line 29 accordingly to account for multiple values.

* Remove status3 as used in line 71 in status_store.go.

* Undid change in storetest/status_store.go on line 67 which checked for wrong thing
2019-07-01 07:44:26 -04:00
Alex Sahin
1aa1363e63 [MM-16568] Migrate "User.SearchInChannel" to Sync by default (#11417)
* implemented migration to sync

* updated user.go to use explicit async approach
2019-07-01 12:44:09 +02:00
Deepak Sah
f8ba59ca9e [MM-16567] Migrate "User.SearchNotInTeam" to Sync by default (#11471) 2019-06-29 00:24:46 +02:00
Marc Argent
3bce32bbcf GH-11385 Migrate User.AnalyticsGetInactiveUsersCount to Sync by default (#11432)
* GH-11385 Migrate User.AnalyticsGetInactiveUsersCount to Sync by default

* GH-11385 fix TestGetAnalyticsOld
2019-06-28 07:39:52 -07:00
Nafis Faysal
ac4019afe5 [MM-11157] Migrate "Channel.UpdateMember" to Sync by default (#11328)
* Migrate Channel.UpdateMember to Sync by default

* Migrate Channel.UpdateMember to Sync by default

* generate store-mocks

* fix signature mismatch error

* fix shadow err
2019-06-28 14:41:50 +02:00
Martin Kraft
ab4eaf898b Changes method name, removes error case. (#11427)
* Changes method name, removes previous error case.

* Fixes test now that the method is idempotent.
2019-06-28 07:31:32 -04:00
Claudio Costa
22fb7d9116 Migrate User.GetAllAfter to Sync by default (#11446) 2019-06-28 12:40:09 +02:00
Marc Argent
591c73310c GH-11298 Migrate UserAccessToken.UpdateTokenEnable to Sync by default (#11418) 2019-06-28 11:02:51 +01:00
SezalAgrawal
a86b204105 [MM-16520] Migrate "Status.ResetAll" to Sync by default (#11424)
* Updated ResetAll function to return object

* Modified the defined interface

* Changed the data type where ResetAll was referrenced

* Refactored code

Changed user's email

* Fixed indentation
2019-06-28 10:32:57 +01:00
Kévin Etienne
ea8d441345 MM 16523 Migrate "LinkMetadata.Save" to Sync by default (#11416)
* Update LinkMetadata.Save store and interface

* Update mocks with make store-mocks

* Update tests and implementation
2019-06-28 10:28:08 +01:00
Adzim Zul Fahmi
73e47567bc [MM-16339] Migrate "Channel.GetPinnedPosts" to Sync by default (#11280)
* Migrate "Channel.GetPinnedPosts" to Sync by default

* remove unnecessary error checking

* fixing shadowed err variable

* fixing shadowed err variable

* fixing gofmt
2019-06-28 08:53:47 +02:00
Jesper Hansen
86e0c8567c [MM-16183] Store: Migrate TeamStore.GetChannelUnreadsForAllTeams to sync as default #11116 (#11400) 2019-06-27 22:12:54 +02:00
Harrison Healey
4b96437370 MM-16477 Add api to get users modified since a given time (#11406)
* MM-16477 Add api to get users modified since a given time

* Address feedback
2019-06-27 09:37:03 -04:00
Maxim Zaks
89a41dc381 Migrate "User.SearchWithoutTeam" to Sync by default (#11421) 2019-06-27 13:44:53 +01:00
Deepak Sah
77ed6015fd [MM-16513] Migrate Token.Delete to Sync by default (#11365)
* Made changes to TokenStore interface, Delete()

* Modified user.go

* Refactored app/user.go
2019-06-27 13:14:17 +02:00
Claudio Costa
eb8b475497 Migrate User.GetTeamGroupUsers to Sync by default (#11414) 2019-06-27 15:59:49 +08:00
lassimus
8841e3dab9 MM-16564 Migrate "User.GetRecentlyActiveUsersForTeam" to Sync by default #11392 (#11399) 2019-06-26 15:46:38 -04:00
Claudio Costa
44b9fe3110 MM-16579 Migrate User.GetChannelGroupUsers to Sync by default (#11412)
* Migrate User.GetChannelGroupUsers to Sync by default

* Directly return Store results
2019-06-26 18:42:21 +02:00
Alex Sahin
cb7c549c7b migrated to sync (#11407) 2019-06-26 11:27:29 -04:00
Alex Sahin
6ff393527e implemented migration to sync (#11413) 2019-06-26 16:51:02 +02:00
Jesper Hansen
2193e43aac [MM-16561] Store: Migrate UserStore.GetUnreadCount to sync as default #11395 (#11409) 2019-06-26 15:48:20 +01:00
Deepak Sah
9bab407f26 [MM-16519] Migrate Status.GetOnlineAway to Sync by default (#11410)
* Made changes to status_store.go store/store.go

* Modified test file and updated mocks
2019-06-26 10:44:37 -04:00