Skip to content

fix: incorrect enum value, swapped log rotation descriptions, wrong JSDoc, and stray artifacts in error messages#1279

Open
ZLeventer wants to merge 1 commit into
forcedotcom:mainfrom
ZLeventer:fix/bugs-wrong-values-and-swapped-descriptions
Open

fix: incorrect enum value, swapped log rotation descriptions, wrong JSDoc, and stray artifacts in error messages#1279
ZLeventer wants to merge 1 commit into
forcedotcom:mainfrom
ZLeventer:fix/bugs-wrong-values-and-swapped-descriptions

Conversation

@ZLeventer
Copy link
Copy Markdown

Summary

Five bugs found across org.ts, envVars.ts, envVars.md, configAggregator.ts, and scratchOrgInfoGenerator.md:

src/org/org.ts:1868TRIAL_EXPIRATION_DATE enum has wrong string value

// before
TRIAL_EXPIRATION_DATE = 'trailExpirationDate',

// after
TRIAL_EXPIRATION_DATE = 'trialExpirationDate',

This enum value is used as a property key when reading auth fields from the org. The Salesforce API returns trialExpirationDate; the typo (trail) would cause trial expiration date lookups to silently return undefined.

src/config/envVars.ts:263SFDX_LAZY_LOAD_MODULES shows wrong description

// before
[EnvironmentVariable.SFDX_LAZY_LOAD_MODULES]: {
  description: getMessage(EnvironmentVariable.SFDX_USE_PROGRESS_BAR),  // copy-paste bug

// after
[EnvironmentVariable.SFDX_LAZY_LOAD_MODULES]: {
  description: getMessage(EnvironmentVariable.SFDX_LAZY_LOAD_MODULES),

SFDX_LAZY_LOAD_MODULES displayed the help text for SFDX_USE_PROGRESS_BAR instead of its own description. Every other entry in SUPPORTED_ENV_VARS correctly references its own key.

messages/envVars.mdsfdxLogRotationCount / sfdxLogRotationPeriod descriptions are swapped (both SFDX_ and SF_ variants)

sfdxLogRotationCount had the rotation-period description ("Example '1d' will rotate logs daily"), and sfdxLogRotationPeriod had the count description ("3 backup files to keep"). Same swap in the sfLogRotationCount / sfLogRotationPeriod entries. Fixed by swapping both pairs back to their correct keys.

src/config/configAggregator.ts:291-293getLocation() JSDoc lists GLOBAL and ENVIRONMENT backwards

The JSDoc said GLOBAL for env vars and ENVIRONMENT for global config, which is the opposite of what the method actually returns. Corrected to match the implementation.

messages/scratchOrgInfoGenerator.md — 5 error messages have trailing ", artifacts

Remnants of a JSON-to-markdown migration. Each affected message would appear with a literal trailing ", in user-facing error output (e.g., "...scratch org definition.","). Removed the artifacts from all 5 messages.

Test plan

  • yarn build passes
  • Existing tests pass
  • Manual: sf env var list should show correct descriptions for SFDX_LAZY_LOAD_MODULES and log rotation vars

…wrong JSDoc

- org.ts:1868 — TRIAL_EXPIRATION_DATE = 'trailExpirationDate' → 'trialExpirationDate'
  This enum value is used as a property key when reading auth fields from the org.
  The Salesforce API returns 'trialExpirationDate' (not 'trail'); the typo would
  cause trial expiration date lookups to silently return undefined.

- envVars.ts:263 — SFDX_LAZY_LOAD_MODULES used getMessage(SFDX_USE_PROGRESS_BAR)
  Copy-paste bug: the description for SFDX_LAZY_LOAD_MODULES displayed the help
  text for SFDX_USE_PROGRESS_BAR instead of its own description.

- envVars.md — sfdxLogRotationCount/sfdxLogRotationPeriod descriptions were swapped
  (both SFDX_ and SF_ variants). Count had the period description ("'1d' will rotate
  logs daily") and Period had the count description ("3 backup files to keep").

- configAggregator.ts:291-293 — getLocation() JSDoc listed GLOBAL for env var and
  ENVIRONMENT for global config, which is the opposite of what the code returns.

- scratchOrgInfoGenerator.md — 5 error messages had trailing '", ' artifacts
  (remnants of a JSON-to-markdown format migration) that would appear verbatim in
  user-facing error output.
@ZLeventer ZLeventer requested a review from a team as a code owner April 24, 2026 15:32
Copy link
Copy Markdown
Contributor

@jshackell-sfdc jshackell-sfdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve markdown updates only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants