Skip to content

Conversation

BrandonNoad
Copy link
Contributor

@BrandonNoad BrandonNoad commented Sep 5, 2025

What this does:

Config objects are no longer cloned. If a TokenCredential was being passed as config.authentication.options.credential, it wasn't being handled correctly (see #1745 (comment) for more details)

Related issues:

Fixes #1745

Pre/Post merge checklist:

  • Update change log

@BrandonNoad
Copy link
Contributor Author

The README mentions that the config is cloned a few different times e.g., "It is safe to pass read-only config objects to the library; config objects are now cloned". Not sure how you want to handle this re: breaking changes

@dhensby
Copy link
Collaborator

dhensby commented Sep 8, 2025

Thanks for taking the time to do this, please can you reword the commit to meet the commit conventions (https://www.conventionalcommits.org/en/v1.0.0/); I'd suggest this is feat:.

RE docs, yeah - we should change that to remove the mention that we clone the config object and that any subsequent modifications by reference will lead to undefined behaviour.

@dhensby dhensby force-pushed the feat/rm-config-cloning branch from 24e0620 to f37c02a Compare September 30, 2025 10:52
@dhensby
Copy link
Collaborator

dhensby commented Sep 30, 2025

I've gone and updated the commit message; I could only see the one instance of the docs mentioning cloned config objects and that was the upgrade guide for a very old version, so I don't think that should be removed.

@dhensby dhensby force-pushed the feat/rm-config-cloning branch from f37c02a to 800027b Compare September 30, 2025 11:00
BREAKING CHANGE: Config objects are not longer cloned by the library.
The objects are intended to be readonly and that no modification happens
to them during the lifetime of the process, changing these values will result
in undefined behaviour.
@dhensby dhensby force-pushed the feat/rm-config-cloning branch from 800027b to 5fcc7d7 Compare September 30, 2025 11:09
@BrandonNoad
Copy link
Contributor Author

I've gone and updated the commit message; I could only see the one instance of the docs mentioning cloned config objects and that was the upgrade guide for a very old version, so I don't think that should be removed.

Thank you. Sorry for the delay on my end.

@dhensby dhensby merged commit 31449a2 into tediousjs:master Sep 30, 2025
43 checks passed
Copy link

🎉 This PR is included in version 12.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: The "config.authentication.options.credential" property must be an instance of the token credential class

2 participants