Commit Graph

11265 Commits

Author SHA1 Message Date
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
Jesús Espino
c0b51b03de MM-16548: Fixing bug with empty type in the second line of the bulk import (#11567)
* MM-16548: Fixing bug with empty type in the second line of the bulk import

* Adding tests to this behavior

* Changing the approach to fix the problem
2019-07-08 16:17:06 +01:00
George Goldberg
efc342f294 MM-16625: Set UpdateAt correctly on deleting profile pic. (#11525) 2019-07-08 11:16:32 -04:00
Claudio Costa
1bd6d9a90b MM-10982 Support relative links in interactive message buttons (#11477)
* Add support for relative callback URLs to plugins

* Update relative URL check and make it more robust

* Add leading slash to input relative path
2019-07-08 08:50:55 -03: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
Jesús Espino
da6cb83f9b Allow to export global relay to zip (#11492)
* Allow to export global relay to zip

* Addressing review comments
2019-07-08 11:06:59 +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
Ali Farooq
2ecca12bed MM-15452 - Add ability to override LHS icon for bot accounts (#11423)
* MM-15452 - Add ability to override LHS icon for bot accounts

* MM-15452 - Added translations

* MM-15452 - Updated GetIconImage test to check returned image

* MM-15452 - Added Delete handler for /icon endpoint, invalidating user cache on set/delete

* MM-15452 - Moved /icon routes under bot/, addressed other pr feedback

* MM-15452 - More conflict resolutoin

* MM-15452 Restoring api4/user.go

* MM-15452 - Using require as opposed to t for test assertions

* MM-15452 - Updated as per PR feedback
2019-07-06 08:56:21 +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
Christopher Poile
8d100af052 [MM-16719] Setting the MM_SQLSETTINGS_DATASOURCEREPLICAS environment variable breaks the server startup (#11504)
* [MM-16719] fixing reflection: now recursing on value, not interface

adding defaults to cfgWithoutEnvOverrides
adding tests

* don't modify the minimalConfig
2019-07-05 18:10:48 -04:00
Jesse Hallam
620d941b6e MM-8602: KV Store Json helper tweaks (#11502)
* move kv helpers to helpers_kv*.go

* change KVGetJSON return signature

Return a boolean and an error, to clearly indicate if no value was found and thus no value unmarshalled into the target interface.

Also fix an issue with CompareAndSet to allow an oldValue of nil (i.e.
expected to be unset).

* add missing license

* tweak documentation

* document KVSetWithExpiryJSON minimum version
2019-07-05 17:33:39 -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
Jesse Hallam
25f3bf4a2b MM-16506: conditionally build go.mod for plugins (#11430)
* MM-16506: conditionally build go.mod for plugins

Unless `GO111MODULE=off`, generate a `go.mod` that points at the local copy of `mattermost-server` to ensure plugin tests that compile source code on demand always test with the local copy of mattermost-server.  This also fixes an issue with early adopters of `GO111MODULE=on` on the server failing to find the right version of go-i18n dependencies.

* plugin: enable testlib resource management

* customize fileutils.Find* for testlib
2019-07-05 12:34:49 -03: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
Claudio Costa
d844c52f06 MM-12389 Update segment library to v3 (#11472)
* Update analytics-go dependency

* Migrate from segment library v2 to v3

* Reinclude gorilla/handlers module

* Fix missing module

* Remove reference to outdated analytics module
2019-07-04 12:26:41 -07:00
Daniel Schalla
c9e289f828 [MM-16697] Rework validation of team and channel membership for webhook updates (#11483)
* Validate team and channel membership for webhook updates

* Implerment review feedback

* Readability

* Additional controls for team id comparison
2019-07-04 18:22:10 +02:00
Miguel de la Cruz
8a13c9d1d5 [MM-15661] Create SendNotificationEmail and move config option check to it (#11478) 2019-07-04 14:16:41 +01: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
Daniel Schalla
68703f9b76 Verify team membership when returning command list (#11487) 2019-07-04 14:52:47 +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
Gabe Jackson
f56a8f5a99 [MM-16620] Properly handle analytics client life cycle
Properly handle analytics client life cycle

This change improves the life cycle management of the analytics
client. It does so in two primary ways:
 - Move the client from being a shared pointer to belonging to the
   Server struct.
 - Expose the client.Close() method for proper shutdown of the
   client.
2019-07-03 12:28:51 -04:00
Phillip Ahereza
df869e3f86 SyncStore: Migrate User.GetForLogin method to Sync (#11501) 2019-07-03 11:12:33 -04:00
Harrison Healey
0b89aa2472 MM-16682 Update NPS plugin to 1.0.1 (#11499) 2019-07-03 09:16:57 -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
Claudio Costa
c95d295dce Update CLI channel list and search commands to show if a channel is private (#11480) 2019-07-02 16:27:00 -04: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