Skip to content
Snippets Groups Projects
Unverified Commit 15b6f4b7 authored by Matheus Barbosa Silva's avatar Matheus Barbosa Silva Committed by GitHub
Browse files

regression: Disable marketplace apps on license removal or downgrade (#33628)

parent e3629e06
No related branches found
No related tags found
No related merge requests found
......@@ -204,6 +204,12 @@ export class AppServerOrchestrator {
await Promise.all(apps.map((app) => this.getNotifier().appUpdated(app.getID())));
}
async disableMarketplaceApps() {
const apps = await this.getManager().get({ installationSource: 'marketplace' });
await Promise.all(apps.map((app) => this.getManager().disable(app.getID())));
}
async unload() {
// Don't try to unload it if it's already been
// unlaoded or wasn't unloaded to start with
......
......@@ -4,12 +4,13 @@ import { Meteor } from 'meteor/meteor';
import { Apps } from '../../apps';
Meteor.startup(async () => {
const migratePrivateAppsCallback = async () => {
const updateAppsCallback = async () => {
if (!Apps.isInitialized) return;
void Apps.migratePrivateApps();
void Apps.disableMarketplaceApps();
};
License.onInvalidateLicense(migratePrivateAppsCallback);
License.onRemoveLicense(migratePrivateAppsCallback);
License.onInvalidateLicense(updateAppsCallback);
License.onRemoveLicense(updateAppsCallback);
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment