* add webhook id to logs
* Move hook_id context to api level from app level.
* pass errCtx to other references of same app-error-id
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* ensure user has invite team permission in order to change setting
* add tests and handle UI
* lint fixes
* revert changes to invite section input
* update tests
* revert bad merge
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* Removed test_update_user_auth_plugin from golangci
The test_update_user_auth_plugin has been removed from the .golangci.yml configuration file. This change simplifies the linting process by excluding unnecessary files.
* Refactored error handling in user auth tests
The error handling for the 'expectUserAuth' function within the user authentication plugin tests has been refactored. Previously, errors were not being explicitly checked after each call to this function. Now, an error check is performed after each invocation and if an error is found, it's immediately returned. This change improves the robustness of our test suite by ensuring that potential issues are caught and handled appropriately during testing.
* Refactor error handling in UpdateUserAuth
The error handling in the UpdateUserAuth function has been refactored. The variable 'err' was replaced with 'appErr' to better reflect its purpose and improve code readability.
* Updated user authentication in plugin API
The user authentication method in the plugin API has been updated. Previously, it was fetching the user based on a static configuration value. Now, it fetches the user dynamically using the provided userID. This change makes the function more flexible and adaptable to different use cases.
* Updated golangci configuration
Removed a test file from the exclusion list in the golangci.yml configuration. This will allow linting checks to be performed on this previously excluded file, improving code quality and consistency.
* Updated golangci configuration
Removed a test file from the exclusion list in the golangci configuration. This will ensure that our linting tools also cover this previously excluded test file, improving overall code quality checks.
---------
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
We don't clear the Redis cache for every test.
This can cause issues because the cache is shared
across test. We fix that with this PR.
```release-note
NONE
```
There were couple of errors in the test:
1. UpdatedScheduledPost will automatically
set the ProcessedAt to now internally inside
toUpdateMap. So setting the value from outside
has no effect.
2. The bug was that if it took more than a
milisecond to capture the time, and then
do the internal call, then the Get call
will have a higher value and therefore fail.
Since UpdatedScheduledPost doesn't return
an updated post, so there is no need
to compare the timestamps at all.
```release-note
NONE
```
* Stop recording unknown platforms as "Windows" in Sessions table
* Add more tests to user_agent_test.go
* MM-61012 Add special handling to OS detection for mobile apps
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
Essentially applying the fix for https://github.com/mattermost/mattermost/pull/29214
to the web package. It seems like the app.StoreOverrideWithCache
function was never used in this package.
Just a small highlight of how much boilerplate is repeated
in multiple packages
```release-note
NONE
```
Co-authored-by: Mattermost Build <build@mattermost.com>
And re-order the server initialization (AGAIN).
For the nth time, we found several bugs in the initialization
process.
1. filestore.NewExportFileBackend and filestore.NewFileBackend
depended on license, but the license wasn't even loaded until
later!
2. The `ps.sqlStore.UpdateLicense` call also didn't work
because the license wouldn't get loaded. It only accidentally
worked because of `ps.AddLicenseListener` which would update
the license later on. We remove that.
Ideally, we would have loaded the license first and then
checked for redis client, but it's very difficult to do that.
Reasons are explained in the code comment.
So we just wait until the license is loaded, and simply throw an
error later.
https://mattermost.atlassian.net/browse/MM-61229
```release-note
NONE
```
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
* MM-61731-enhance-failed-sent-system-bot-message
* adjust test and adjust i18n messages
* set back correct value
* improve naming and get channels logic
* hide channel name if the channel is private
---------
Co-authored-by: Mattermost Build <build@mattermost.com>