Skip to content

Conversation

@THardy98
Copy link
Contributor

What was changed

Envconfig fix, to use OS-specific config file paths

Why?

This is the correct behaviour (as documented)

  1. Closes Environment Configuration does not read the correct file path on macOS #2754

  2. How was this tested:
    Added test

  3. Any docs updates needed?
    No

@THardy98 THardy98 requested a review from a team as a code owner January 15, 2026 19:46
@THardy98 THardy98 changed the title fix: envconfig - use OS-specific config file paths fix: envconfig, use OS-specific config file paths Jan 15, 2026
if (osName != null) {
String osNameLower = osName.toLowerCase();
if (osNameLower.contains("mac")) {
return userDir + "/Library/Application Support/temporalio/temporal.toml";
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Not a big deal, but it's preferable to avoid building paths by simply concatenating raw strings.

Suggested change
return userDir + "/Library/Application Support/temporalio/temporal.toml";
return Paths.get(userDir, "Library", "Application", "Support", "temporalio", "temporal.toml").toString();

Same for other below.

* Get the default config file path based on the operating system:
*
* <ul>
* <li>macOS: $HOME/Library/Application Support/temporalio/temporal.toml
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is on a private method, where it is less likely to be found by a user that wonders where ClientConfig is storing its data, which is a typical and legitimate question for a user. I'd suggest moving this bullet list to the class's javadoc instead, then just add a reference to that here.

Copy link
Contributor

@mjameswh mjameswh left a comment

Choose a reason for hiding this comment

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

Minor comments, nothing blocking.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Environment Configuration does not read the correct file path on macOS

3 participants