Changelog - 2026-09-12
An env read now does what it promises
Fix BreakingIn one line. APP_ENV_HOST= in a deployment file used to read as '', which passed every falsy guard and then failed later with an unrelated message. It now falls back to your defaultValue.
ts
// APP_ENV_SERVER_PORT= (present, empty)
applicationEnvironment.get('APP_ENV_SERVER_PORT', { defaultValue: '3000' });
// before: '' after: '3000'What changed
- Only where you asked for a default. The normalisation runs only when the call supplies a
defaultValue. A read without one is untouched. Whitespace counts as empty;'0'and'false'are values and are never normalised. transformgetsundefined. For an empty line atransformnow receivesundefined, not'', so it no longer has to guard against the empty string.- Put the fallback inside the read.
int()is unchanged: it always answers a number, and answers0for anything it cannot parse, so??after it is dead code. A retry budget that reads0makesAbstractRedisHelper.buildRetryStrategygive up after the first reconnect failure.
ts
int(applicationEnvironment.get(KEY, { defaultValue: '6379' })); // correct
int(applicationEnvironment.get(KEY)) ?? 6379; // always 0 when KEY is unset- Two env names deleted (Breaking).
EnvironmentKeys.APP_ENV_OAUTH2_VIEW_FOLDERandEnvironmentKeys.APP_ENV_DATASOURCE_NAMEhad no reader anywhere.EnvironmentKeysnow holds 15 names: 5 the framework reads, 10 conventions your own code reads.
Who is affected
- You read an env name that a deployment sets empty. You now get your
defaultValueinstead of''. If any of your code treats''as meaningful AND passes adefaultValuefor that same read, it now takes the default. - You call
get()without adefaultValue. Nothing changes. - You set
APP_ENV_OAUTH2_VIEW_FOLDERorAPP_ENV_DATASOURCE_NAME. Delete the line. Leaving it is harmless. - You reference either name in TypeScript. That no longer compiles. Declare the name in your own
EnvironmentKeyssubclass.
Breaking changes
WARNING
Code that references EnvironmentKeys.APP_ENV_OAUTH2_VIEW_FOLDER or EnvironmentKeys.APP_ENV_DATASOURCE_NAME no longer compiles.
Before: both names exist on EnvironmentKeys.
After: they are gone. Declare the name in your own EnvironmentKeys subclass if you need it.