Fix ConsentInterceptor destroying sibling entries in repeating fields (e.g. contained) when replacing a resource - #8213
Open
jkiddo wants to merge 1 commit into
Open
Conversation
Collaborator
|
Formatting check succeeded! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request addresses an important bug (#8212) in the
ConsentInterceptorrelated to handling resources in repeating fields (such ascontained) when processed by anIConsentService. Previously, replacing a resource in a repeating field could inadvertently remove all sibling entries, but this is now fixed. The changes also add comprehensive tests to ensure correct behavior and document the fix.Bug fix for replacing resources in repeating fields:
IMutatorinterface and its implementations (BaseRuntimeDeclaredChildDefinition,RuntimeChildExt) to add areplacemethod that swaps only the targeted entry in a repeating field, instead of clearing the entire list. [1] [2] [3]ConsentInterceptorto use the newreplacemethod instead ofsetValue, ensuring that only the intended resource is replaced and sibling entries remain unaffected.Testing and documentation:
ConsentInterceptorTestto verify that all contained resources survive when unchanged and that replacements occur in place without disturbing sibling entries. [1] [2] [3] [4]