* Adding email and scaffolding for payment failure in case where customer has not added payment method
* Adding email template
* Remove unused boolean
* Fix error
* Add Email Us verbiage
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Implement unzip function
* Implement FileSize method
* Implement path rewriting for bulk import
* Small improvements
* Add ImportSettings to config
* Implement ListImports API endpoint
* Enable uploading import files
* Implement import process job
* Add missing license headers
* Address reviews
* Make path sanitization a bit smarter
* Clean path before calculating Dir
* [MM-30008] Add mmctl support for file imports (#16301)
* Add mmctl support for import files
* Improve test
* Remove unnecessary handlers
* Use th.TestForSystemAdminAndLocal
* Make nouser id a constant
* Removing supplier concept from the sql store
* Removing other metions to supplier
* Fixing gofmt
* Fixing gofmt
* Renaming NewSqlStore to New
* Fixing tests
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* MM-30988 - Fix racy test ServerSystemdNotification
The translateFunc is a global variable which was unguarded.
So we convert that into an atomic variable to prevent against races.
https://mattermost.atlassian.net/browse/MM-30988
```release-note
NONE
```
* fix tests
* move call upwards
* use race
* after translations init
* guard with a sync.Once
* missed import
* revert race
* update timeout
* Add a new handler to allow authentication via CWS API Key
* Make error better
* Add tests and cases for new handler functions
* Move some code around
* Add test for GetCloudSession function
* unset the env after test completion
* Remove white space
* Add CWS Webhook endpoint and email code
* handle returned errors from email sending function
* Change FailureCode to FailureMessage
* Remove unnecessary translations
* Fix translations
* Forgot to add template
* Update api4/cloud.go
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
* Update api4/cloud.go
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
* Update api4/cloud.go
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
* PR changes
* Update app/email.go
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
* Close body in proper spot
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Maria A Nunez <maria.nunez@mattermost.com>
Co-authored-by: Mario de Frutos Dieguez <mario@defrutos.org>
* Add a new handler to allow authentication via CWS API Key
* Make error better
* Add tests and cases for new handler functions
* Move some code around
* Add test for GetCloudSession function
* unset the env after test completion
* Remove white space
* Change Info to Warn
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
A cluster changed listener always runs in a separate goroutine.
This causes a race condition when a new member gets added in the cluster.
We fix it by accessing the value atomically.
I tried to write a test for this, but it wasn't triggering at all.
The best way is to just start the server with cluster enabled in race mode,
and verify that the race doesn't happen.
https://mattermost.atlassian.net/browse/MM-30319
```release-notes
NONE
```
* MM-29107: Fix race in LDAP login
We remove the goroutine to make things synchronous.
This removes the race and makes things more reliable.
It is already tested by TestLogin in ldap_test.go in -race mode.
https://mattermost.atlassian.net/browse/MM-29107
```release-note
NONE
```
* Address review comments
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
The code was doing `go fakeApp.UpdateProductNotices()`
due to which the Store object was accessed in a racy manner
when it was reset if the localcachelayer flag was set.
We fix this by using the StoreOverride functionality
to pre-define what store to use while initializing the server
itself so that there isn't a need to reset the store _after_
the server is set.
We also apply the same fix in the app and api4 layers too
to prevent similar things from happening there.
https://mattermost.atlassian.net/browse/MM-29487
```release-note
NONE
```
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Make UpdateSidebarCategories return the original categories
* MM-20897 Add category muting
* Prevent muting the DMs category
* Fix muted state not being stored in the database
* Address feedback
* Address some feedback
* Fix unit tests
* MM-20897 Mute/unmute channels in the database in bulk
* Satisfy golangci-lint