Skip to content

Conversation

@ChrisDoernen
Copy link
Contributor

@ChrisDoernen ChrisDoernen commented Dec 15, 2025

Hey!

I am proposing to not build the configuration root until constructors of derived classes have run.

This way we can change the environment variables in the constructor of derived classes (e.g. load with Dotenv). Right now, we are loading env variables with dotnev but they are actually not showing up in the configuration because the configuration has already been built before the constructor ran.

The same will be true for user secrets, this is why I moved that line, too (allthough I am not using that feature right now). In my IDE, I am getting a warning "virtual member call in constructor" which would be resolved as well.

image

Best

Chris

@Arash-Sabet
Copy link
Contributor

@ChrisDoernen Do you have a test class to include in your forked repo for my review too? I wanna ensure it's not a breaking change.

@Arash-Sabet Arash-Sabet self-assigned this Dec 15, 2025
@Arash-Sabet Arash-Sabet added the enhancement New feature or request label Dec 15, 2025
@ChrisDoernen
Copy link
Contributor Author

ChrisDoernen commented Dec 15, 2025

@Arash-Sabet ok, I added a new test to demonstrate the use case (ConfigurationTests).

All tests are green on my laptop:
image

@Arash-Sabet
Copy link
Contributor

@ChrisDoernen Thanks. Please give me a couple of days to verify the changes.

@Arash-Sabet Arash-Sabet self-requested a review December 15, 2025 23:57
@Arash-Sabet Arash-Sabet merged commit ca05132 into Umplify:main Dec 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants