-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The onCreateCollection Op Observer currently receives a growing list of parameters, including optional and boolean values. This makes the code increasingly complex to read and maintain. Additionally, introducing new parameters to this function requires updating 18 different files, including observers that override the method and related tests. In most cases, only a few of these files are directly impacted by the new parameter, making the process unnecessarily cumbersome.
To address these challenges, it would be beneficial to refactor the method to use a parameter struct. Bundling all relevant parameters into a single struct improves readability, reduces the number of parameters passed around, and simplifies the process of adding new parameters in the future. Such a change would enhance both code maintainability and clarity across the impacted files.