Feature/issue 261 export tags -Prune unrelated channel IDs from exported channel tags#288
Conversation
ea12eec to
11557b3
Compare
11557b3 to
ba793e4
Compare
tonygermano
left a comment
There was a problem hiding this comment.
I have a few questions about these changes and the associated issue.
- Where is the import code that looks at this information? Presumably it would need to create the tag in some situations and not create it in others. Can we be certain that this will not cause unwanted behavior in some scenarios?
- The issue suggests emptying the channel list from the exported tag entirely. Is there a reason to keep the current channel Id rather than using an empty Set?
- The issue also identifies a problem with the tags reporting incorrect channel values/counts. Can we confirm why that was the case, and whether this PR resolves that issue or not?
| private void addTagsToChannel(Channel channel) { | ||
| List<ChannelTag> channelTags = new ArrayList<ChannelTag>(); | ||
| for (ChannelTag channelTag : getCachedChannelTags()) { | ||
| if (channelTag.getChannelIds().contains(channel.getId())) { | ||
| ChannelTag exportTag = new ChannelTag(channelTag); | ||
| exportTag.setChannelIds(Collections.singleton(channel.getId())); | ||
| channelTags.add(exportTag); | ||
| } | ||
| } | ||
|
|
||
| if (CollectionUtils.isNotEmpty(channelTags)) { | ||
| channel.getExportData().setChannelTags(channelTags); | ||
| } |
There was a problem hiding this comment.
chore: there appears to be a whitespace issue here
Most of this method did not change.
There was a problem hiding this comment.
I fixed this up in the newer one
Signed-off-by: DESKTOP-9AKG4SL\ecomeau <ecomeau@caredx.com>
Signed-off-by: DESKTOP-9AKG4SL\ecomeau <ecomeau@caredx.com>
248e7e9 to
61cbf7a
Compare
Thanks The serialized list of channels is really only used for NEW tags.
|
Summary
Prunes exported channel tag membership so channel exports only include the exported channel's ID in each tag.
Changes
Verification