Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Entries in Added and Removed Lists in Diff Mode #330

Closed
ksg97031 opened this issue Jun 19, 2024 · 1 comment · Fixed by #335
Closed

Duplicate Entries in Added and Removed Lists in Diff Mode #330

ksg97031 opened this issue Jun 19, 2024 · 1 comment · Fixed by #335
Assignees
Labels
🐞 bug Something isn't working 📦 output-builder Issue for output builder (format)
Milestone

Comments

@ksg97031
Copy link
Member

Describe the bug
When running the OutputBuilderDiff class to compare two sets of endpoints, the added and removed lists contain duplicate entries. This issue likely occurs because the Endpoint class does not implement the == and hash methods, leading to improper comparison and hashing of endpoint objects.

To Reproduce
Steps to reproduce the behavior:

  1. Run the OutputBuilderDiff class with two sets of endpoint data.
  2. Observe the added and removed lists in the output.
  3. Notice that many endpoints are incorrectly listed as both added and removed, despite having the same URL, method, and parameters.

Expected behavior
The added list should contain only the endpoints that are present in the new set but not in the old set. The removed list should contain only the endpoints that are present in the old set but not in the new set. Endpoints that are unchanged should not appear in either list.

Screenshots
image

Versions

  • OS: macOS
  • Version: v0.16.0

Additional context
The bug is likely due to the Endpoint class not implementing the == and hash methods. This may lead to endpoints with the same properties being treated as different objects. Implementing the == method to compare the URL, method, and parameters of the endpoints, and the hash method to generate a hash based on these properties, should ensure proper functionality in hash-based data structures.

@ksg97031 ksg97031 added the 🐞 bug Something isn't working label Jun 19, 2024
@hahwul
Copy link
Member

hahwul commented Jun 20, 2024

@ksg97031
I'll take care of it in the next version! Thank you for the report :)

@hahwul hahwul added this to the NextVersion milestone Jun 20, 2024
@hahwul hahwul added the 📦 output-builder Issue for output builder (format) label Jun 20, 2024
hahwul added a commit that referenced this issue Jun 26, 2024
🧪 Implement endpoint comparison logic in diff analysis for #330
@hahwul hahwul closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 📦 output-builder Issue for output builder (format)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants