Skip to content

fix: data loss during network package deduplication#49

Open
Jaydeep869 wants to merge 1 commit into
SBOMit:masterfrom
Jaydeep869:fix-network-dedupe
Open

fix: data loss during network package deduplication#49
Jaydeep869 wants to merge 1 commit into
SBOMit:masterfrom
Jaydeep869:fix-network-dedupe

Conversation

@Jaydeep869
Copy link
Copy Markdown
Contributor

Description

Fixes #40

Network package deduplication in pkg/resolver/network/network.go was previously using a "first-wins" logic (map[string]struct{}). If a lightweight metadata trace was processed before a richer archive trace, later fields (like Hashes or DownloadURL) were being lost.

This PR replaces the deduplication method with a merge logic by mapping the PURL to the index in the original array. When duplicate PURLs are found, it intelligently merges missing metadata (e.g., DownloadURL, DownloadIP, Licenses, and Hashes) into the existing package entry.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Signed-off-by: jaydeep869 <jaydeeppokhariya2106@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Data Loss During Network Package Deduplication

1 participant