Enhance report handling and inheritance in modification processing #878
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



PR Summary
This pull request introduces several enhancements to the management of modification reports in the study server, focusing on robust report inheritance, safe deletion, and improved report reuse. The changes ensure that reports are not accidentally deleted when nodes are invalidated, support distinguishing between inherited and new reports, and optimize report lookup logic for efficiency and correctness.
Key changes include:
Report Inheritance & Management
BuildInfosfor tracking both newly generated reports (reportsInfos) and inherited reports (inheritedReportsInfos), along with methods to add inherited reports and retrieve all reports as a single map. This prevents premature deletion of reports referenced by descendant nodes.NetworkModificationTreeServiceto inherit reports from the nearest built ancestor node when building a new node, ensuring proper report reference propagation.StudyServiceto store both new and inherited reports for each node, ensuring the full report set is persisted.Report Uniqueness, Reuse & Safety
RootNetworkNodeInfoServiceto identify which reports can be safely deleted (i.e., not referenced by other nodes) during node invalidation, using new repository queries for efficient reference checks.Data Model Improvements
ReportInfosto include aReportMode(eitherAPPENDorREPLACE), with a default for backward compatibility, and introduced theReportModeenum.