Skip to content

Conversation

@kevo-1
Copy link

@kevo-1 kevo-1 commented Nov 5, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Build related changes
  • Refactoring (no functional changes, no api changes)
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Multiple Data Sources could have had the same name, and no logs to warn about this issue.

Issue Number: #2017

What is the new behavior?

The TypeOrmCore now checks the current name pool using a static Map, and if duplicates where found a comprehensive warning would be logged.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

- Added null/undefined checks in validateDataSourceNames to avoid TypeError.
- Improved logging for duplicate DataSource names
- Added edge case tests (null, undefined, default name,
  multiple duplicates, empty array), all passed
@kevo-1
Copy link
Author

kevo-1 commented Nov 5, 2025

For a better fix, I would suggest taking a unique Id for each Data Source connected and assigning it accordingly.
The unique Id should also be descriptive of what the data source is (e.g. the database name, provider, serialization+provider).

This would require making the Id Map class scoped and tracks the instances to assign new names accordingly.

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.

1 participant