-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update cached setting immediately at the time of updating the db (…
- Loading branch information
Showing
5 changed files
with
153 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@rocket.chat/meteor': minor | ||
--- | ||
|
||
Fixed an issue where adding `OVERWRITE_SETTING_` for any setting wasn't immediately taking effect sometimes, and needed a server restart to reflect. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/meteor/tests/unit/app/settings/server/functions/compareSettingsMetadata.tests.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect } from 'chai'; | ||
|
||
import { compareSettings } from '../../../../../../app/settings/server/SettingsRegistry'; | ||
import { getSettingDefaults } from '../../../../../../app/settings/server/functions/getSettingDefaults'; | ||
|
||
const testSetting = getSettingDefaults({ | ||
_id: 'my_dummy_setting', | ||
type: 'string', | ||
value: 'dummy', | ||
}); | ||
|
||
describe('#compareSettings', () => { | ||
const ignoredKeys = ['value', 'ts', 'createdAt', 'valueSource', 'packageValue', 'processEnvValue', '_updatedAt']; | ||
|
||
ignoredKeys.forEach((key) => | ||
it(`should return true if ${key} changes`, () => { | ||
const copiedSetting: any = { ...testSetting }; | ||
|
||
if (['ts', 'createdAt', '_updatedAt'].includes(key)) { | ||
copiedSetting[key] = new Date(); | ||
} else { | ||
copiedSetting[key] = 'random'; | ||
} | ||
|
||
expect(compareSettings(testSetting, copiedSetting)).to.be.true; | ||
}), | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters