chore: Enable plan reconcile in self hosted (#9357)

This PR will revert the premium config in self hosted instances to its original state if any unauthorised modifications are made.
This commit is contained in:
Sojan Jose
2024-05-08 14:26:00 -07:00
committed by GitHub
parent 73f373913f
commit 3a1299520c
2 changed files with 8 additions and 11 deletions

View File

@@ -5,8 +5,7 @@ class Internal::ReconcilePlanConfigService
create_premium_config_reset_warning if premium_config_reset_required?
# We will have this enabled in the future
# reconcile_premium_config
reconcile_premium_config
reconcile_premium_features
end

View File

@@ -34,15 +34,13 @@ RSpec.describe Internal::ReconcilePlanConfigService do
expect(Redis::Alfred.get(Redis::Alfred::CHATWOOT_INSTALLATION_CONFIG_RESET_WARNING)).to be_nil
end
# To be enabled in the future when method is uncommented
# it 'updates the premium configs to default' do
# create(:installation_config, name: 'INSTALLATION_NAME', value: 'custom-name')
# create(:installation_config, name: 'LOGO', value: '/custom-path/logo.svg')
# service.perform
# expect(InstallationConfig.find_by(name: 'INSTALLATION_NAME').value).to eq('Chatwoot')
# expect(InstallationConfig.find_by(name: 'LOGO').value).to eq('/brand-assets/logo.svg')
# end
it 'updates the premium configs to default' do
create(:installation_config, name: 'INSTALLATION_NAME', value: 'custom-name')
create(:installation_config, name: 'LOGO', value: '/custom-path/logo.svg')
service.perform
expect(InstallationConfig.find_by(name: 'INSTALLATION_NAME').value).to eq('Chatwoot')
expect(InstallationConfig.find_by(name: 'LOGO').value).to eq('/brand-assets/logo.svg')
end
end
context 'when pricing plan is not community' do