Skip to content

Make sure that multiple setModuleDefaults calls update the config sources properly #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

jdmarshall
Copy link
Collaborator

@jdmarshall jdmarshall commented Jun 3, 2025

I don't know if this constitutes a breaking change. I don't know if anyone is relying on configSources for programmatic behavior.

Abundance of caution says yes.

fixes #827

config and the sources being consistent with each other.
@jdmarshall
Copy link
Collaborator Author

I'd like us to sort out the setModuleDefaults issue.

I think I may have a solution we could to in Util to keep the defaults and the loaded config as two separate pieces of data and do the heavy lifting in setModuleDefaults so that it's a zero cost abstraction if nobody is using this feature.

Since it's a startup only operation I'm a little less concerned about the perf. Plus I just landed some perf improvements anyway.

I have another idea for fixing it but it might introduce a circular dependency so I need to think on it more:

const defaults = Util.loadFileConfigs({configDir: Path.join(__dirname, 'config')}); 
const myConfig = Config.withDefaults(defaults);

Copy link
Collaborator

@markstos markstos left a comment

Choose a reason for hiding this comment

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

Looks OK, but let's not merge it ahead of the regression fix, since it's a breaking change and the regression fix may go out before 4.1.

QA Log

  • Reviewed diff
  • Noted extra test coverage.

@jdmarshall
Copy link
Collaborator Author

@markstos So I think we are probably ready for 4.0.1

@markstos
Copy link
Collaborator

4.0.1 is OK with me.

@jdmarshall
Copy link
Collaborator Author

this conflicts a bit with a PR for #822 which also happens to fix this one.

@jdmarshall jdmarshall closed this Jul 15, 2025
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.

[BUG] configSources contains incorrect data from multiple setModuleDefaults calls
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy