fix(core): Schema parsing bypassing config key assignment (#14556)

This commit is contained in:
Guillaume Jacquart 2025-04-11 16:19:06 +02:00 committed by GitHub
parent 8c352293b5
commit d390258001
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,7 @@ export const Config: ClassDecorator = (ConfigClass: Class) => {
);
continue;
}
config[key] = result.data;
} else if (type === Number) {
const parsed = Number(value);
if (isNaN(parsed)) {

View File

@ -404,6 +404,8 @@ describe('GlobalConfig', () => {
it('on invalid value, should warn and fall back to default value', () => {
process.env = {
N8N_RUNNERS_MODE: 'non-existing-mode',
N8N_RUNNERS_ENABLED: 'true',
DB_TYPE: 'postgresdb',
};
const globalConfig = Container.get(GlobalConfig);
@ -413,6 +415,9 @@ describe('GlobalConfig', () => {
"Invalid value for N8N_RUNNERS_MODE - Invalid enum value. Expected 'internal' | 'external', received 'non-existing-mode'. Falling back to default value.",
),
);
expect(globalConfig.taskRunners.enabled).toEqual(true);
expect(globalConfig.database.type).toEqual('postgresdb');
});
});
});