-
Notifications
You must be signed in to change notification settings - Fork 24
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
fix(module-loader) - Fixed ModuleLoader behavior with multiple module catalogs #569
fix(module-loader) - Fixed ModuleLoader behavior with multiple module catalogs #569
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #569 +/- ##
==========================================
- Coverage 74.39% 74.37% -0.03%
==========================================
Files 238 241 +3
Lines 7351 7391 +40
Branches 825 878 +53
==========================================
+ Hits 5469 5497 +28
- Misses 1689 1698 +9
- Partials 193 196 +3
|
2468e9b
to
ca9c9f2
Compare
src/module-loader/dotnet/src/MorganStanley.ComposeUI.ModuleLoader/ModuleLoader.cs
Outdated
Show resolved
Hide resolved
88a28f2
to
cdbe817
Compare
df2d892
to
171236b
Compare
- When multiple ModuleCatalog is being used, some modules could have the same module id in different ModuleCatalog which could cause issue while starting/stopping the application/module via the ModuleLoader. | ||
|
||
## Decision | ||
- If the same module id is being used for multiple modules (even in different ModuleCatalogs), the first occurrence will be used/saved via the ModuleLoader. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same id in the same catalog shouldn't ever exist, although it's fine to describe the behavior.
I'd specify what is the first occurance in case of multiple catalogs though -> e.g. in the order of provider registration sounds like a method that is easy to understand, and provides some agency to the developer. This might have implications on how to implement merging modulecatalogs in case of async fetching.
|
||
| Type | ID | Status | Title | | ||
| ------------- | ------------- | ------------- | ---------------------- | | ||
| ADR | adr-014 | Proposed | Multiple ModuleCatalog | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest discussing and putting the ADR to Accepted state before merging it together with the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will create a new commit with the change of the status once everything is resolved and we discussed.
src/module-loader/dotnet/src/MorganStanley.ComposeUI.ModuleLoader/AggregateModuleCatalog.cs
Outdated
Show resolved
Hide resolved
...oader/dotnet/tests/MorganStanley.ComposeUI.ModuleLoader.Tests/AggregateModuleCatalogTests.cs
Outdated
Show resolved
Hide resolved
|
||
- When multiple ModuleCatalog is being used, some modules could have the same module id in different ModuleCatalog which could cause issue while starting/stopping the application/module via the ModuleLoader. | ||
|
||
## Decision |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just an idea: what if we'd fail fast & hard if there are duplicates, i.e.: throw an exception and crash? What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we talked about it as well last week we talked about that it would be a kind of a weird thing to throw here an exception so we decided to go with the first item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To recap, the issue with failing on duplicates from different sources is that it might cause a situation that the developer/user has no way of resolving.
Ideally this is never an issue but if merging multiple module catalogs is a feature we want to support and we wish to keep the standard interface (and not do something like e.g. prefixing ids that would be non-standard), we need a well documented consistent way of resolving these conflicts that the developer/user has a way to control.
4f15a50
to
cd3318a
Compare
7e305ff
to
6262df0
Compare
Changes: