* Make WebSocketEvent type immutable
* Update code to use updated immutable WebSocketEvent type
* Export WebSocketEvent fields and mark them as deprecated
* 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>
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.
* 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>
* Channel Member update event
* Address PR comments and extend tests
* golang ci addressed
* Update api4/channel_test.go
Co-Authored-By: Ben Schumacher <ben.schumacher@mattermost.com>
* Implement allowing multiple SAML Libraries
* fix unit tests
* updates based on review feedback
* Only set on startup, not config changes
* update unit tests, reload enterprise
* need to reset for previous tests
* update license statement
* fix licensing line
* 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.
* 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
* 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
Go 1.13 introduced this new flag which removes all absolute file system paths
from the binary and just keeps the module path / GOPATH. To debug binary
crashes or stack traces, we only need the path to the code and not the full
file path. Hence this is a quick way to reduce the binary size without any information
loss.
Shaves off around 750KB from the server binary.
* MM-21103: change plugin signature path
Save as `<plugin_id>.tar.gz.sig` instead of `<plugin_id>.sig`. The latter was a relic of the previous design to support multiple plugin signatures, but now creates an inconsistency with how the original source files were supplied as `<some_name>.tar.gz` and `<some_name>.tar.gz.sig`.
Fixes: https://mattermost.atlassian.net/browse/MM-21103
* relax signature matches to avoid assuming signatures always exist
* 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
* Add the old fmt and vet targets to legacy.mk
This is to ease the transition until a time
when everybody has moved to using golangci-lint.
* Just run golangci-lint for make vet
* Add notification, to sysadmins, when a user is disabled and the user
owns bots.
* If the user doesn't have any bots, there is no need to send a
notifcation to sysadmins
* Remove comment
* Update documention link
* Send as System
* Query teams for each sysadmin and add first response to hardcoded link.
* Remove fmt.print debug statements
* remove link with hard-coded team. Will add this as future enhancement
Expose GetDisableBotSysadminMessage function so it can be tested
Add test new function for testing new notification feature
* Fix shadow error
* Swap sentences in the message when System Console > Bot Accounts > Disable bot accounts when owner is deactivated: is set to false
* Another message correction
* Rename Custom Integrations to Integrations
* rename botsDisabled variable to disableBotsSetting
* - increase the number of bots and sysadmins queried to 1000.
- limit the number of bots printed in the post to 10, but mention the
total bots owned by the user
* Enable translations for sysadmin messages
* - Rename function. The actual purpose for the function is to notify
sysadmins that a user, that owned bots, was disabled.
- convert GetDisableBotSysadminMessage from a function to a method.
This allows getting *a.Config().ServiceSettings.DisableBotsWhenOwnerIsDeactivated
in the method and avoids having to pass the value as an input to a
function
* fix "make i18n-extract" error. Reorganize .json file
* Correct the upper range value to be the minimum of number of elements in the
userBots array, or the upper limit (10)
* replace t.fatal with require statements
fix golangci-lint errors
* Create separate message when user managed less than or fewer than 10 bots
Test cases for both message types
* fix i18n sorting
* Using pagination to get the bots and sysadmins instead of setting
arbitrary value for PerPage and only retrieving first page
* only use one translation ID for the message.
push all logic into the template so translators can view the logic
add disableBotsSetting and printAllBots variables to the translation
map
* Break the for loop once len(bots) < perPage value, instead of
breaking once there are no bots. This saves one additional call
Serve static plugin assets with a `Cache-Control: no-cache, public` header. This avoids caching a 404 response for such an asset, preventing it from being loaded until expiry even if the file later becomes available.
This is currently preventing updates of plugins on community and would generally affect any customer with a cache in front of the Mattermost servers.
Fixes: https://mattermost.atlassian.net/browse/MM-20948
* Test added to check support for import of messages sent to your own DM
channel
* Support for single member direct channel messages and posts
Now bulk import is able to export/import the self direct channel and
the posts inside
* Improve how the copy of channel members for DM and DM posts
* Improved the tests for the export self-channels