Mattermost is an open source platform for secure collaboration across the entire software development lifecycle..
Go to file
Agniva De Sarker dd73c2af0f
MM-53879: Fix recursive loading of license (#24200)
There were multiple problems with loading of a license.

1. It was called from inside app/server.go and app/platform/service.go. The first one wasn't really needed anymore, so we remove it.

2. To make loading of a license work across a cluster, the license load action was attached along with the `InvalidateAllCachesSkipSend` method. But the problem with that was that it would even get called in the caller node as well, putting it in a recursive loop.

```
LoadLicense -> SaveLicense -> InvalidateAllCaches -> InvalidateAllCachesSkipSend -> LoadLicense
```

To fix this, we create a dedicated loadLicense cluster event and move it away from the `InvalidateAllCachesSkipSend` method. And then from the caller side, we just trigger this action.

3. We also remove the first call to check license expiration which would load the license again. This is unnecessary because if the license is expired, server wouldn't start at all.

While here, we also make some other improvements like removing unnecessary goroutine spawning while publishing websocket events. They are already handled asynchronously, so there is no need
to create a goroutine for that.

We also remove

```
ps.ReloadConfig()
ps.InvalidateAllCaches()
```

from requestTrialLicense as they are already called from inside `*PlatformService.SaveLicense`.

And lastly, we remove the `*model.AppError` return from `*PlatformService.InvalidateAllCaches` because there was nothing to return at all.

https://mattermost.atlassian.net/browse/MM-53879

```release-note
Fix several issues with loading of a license
```
2023-08-21 20:17:16 +05:30
.github [MM-53840] Add migration workflow (#24211) 2023-08-16 10:09:11 +03:00
api MM-53764 - Fix: Improve limits on Opengraph Data Cache (#24177) 2023-08-17 18:23:39 -04:00
e2e-tests Replace Gfycat with GIPHY in emoji/gif picker (#24236) 2023-08-18 16:02:46 -04:00
server MM-53879: Fix recursive loading of license (#24200) 2023-08-21 20:17:16 +05:30
tools tools/mmgotool: move into monorepo (#24010) 2023-07-17 16:15:58 +03:00
webapp Replace Gfycat with GIPHY in emoji/gif picker (#24236) 2023-08-18 16:02:46 -04:00
.gitignore [MM-53840] Add migration workflow (#24211) 2023-08-16 10:09:11 +03:00
.gitlab-ci.yml Upgrade docker CI image to 23.0.1 (#23664) 2023-06-07 19:49:48 +03:00
.gitpod.yml Add .gitpod.yml to use mattermost-gitpod-config repo for Gitpod configuration (#19984) 2022-04-14 11:02:50 -04:00
.nvmrc Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
CHANGELOG.md Changelog link (#8805) 2018-05-30 10:23:25 -04:00
CODEOWNERS Add CODEOWNERS for migrations (#23020) 2023-04-19 20:01:50 +05:30
CONTRIBUTING.md Remove outdated information from contributing file (#10749) 2019-05-01 23:46:00 +02:00
LICENSE.txt update LICENSE.txt (#22659) 2023-03-27 10:54:06 -03:00
NOTICE.txt Update NOTICE.txt (#24119) 2023-08-11 01:57:32 +03:00
README.md Update README.md: Try cloud instead of use (#24242) 2023-08-10 11:22:01 -07:00
SECURITY.md MM-41988 Updated links to legacy domain about.mm.com (#19552) 2022-03-16 19:47:57 +08:00

Mattermost

Mattermost is an open source platform for secure collaboration across the entire software development lifecycle. This repo is the primary source for core development on the Mattermost platform; it's written in Go and React and runs as a single Linux binary with MySQL or PostgreSQL. A new compiled version is released under an MIT license every month on the 16th.

Deploy Mattermost on-premises, or try it for free in the cloud.

mattermost-hero

Learn more about the following use cases with Mattermost:

Other useful resources:

Table of contents

Install Mattermost

Other install guides:

Native mobile and desktop apps

In addition to the web interface, you can also download Mattermost clients for Android, iOS, Windows PC, macOS, and Linux.

Google Play App Store Windows PC Mac OSX Linux

Get security bulletins

Receive notifications of critical security updates. The sophistication of online attackers is perpetually increasing. If you're deploying Mattermost it's highly recommended you subscribe to the Mattermost Security Bulletin mailing list for updates on critical security releases.

Subscribe here

Get involved

Learn more

License

See the LICENSE file for license rights and limitations.

Get the latest news

Contributing

Please see CONTRIBUTING.md. Join the Mattermost Contributors server to join community discussions about contributions, development, and more.