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

feat!: allow for consuming the same TD twice #140

Merged
merged 1 commit into from
May 19, 2024
Merged

Conversation

JKRhb
Copy link
Member

@JKRhb JKRhb commented May 19, 2024

In the context of #133, I have noticed that the consume method currently throws an exception if you want to consume the same Thing Description twice (or rather: two Thing Descriptions that have the same “identifier”), which can have unintended consequences when performing discovery.

This PR fixes the issue for now by changing the internal data structure from a Map to a Set and not checking for the presence of a Thing Description (using its id or title) anymore. This change is not really optimal and can only be considered a workaround, which I will properly fix as part of a general overhaul of the Servient API (which currently exposes too much API surface to the library user). That overhaul will be the next aspect of the library I will work on.

@JKRhb JKRhb force-pushed the fix-consume-method branch from 4f43f68 to b54450e Compare May 19, 2024 17:22
@JKRhb JKRhb enabled auto-merge May 19, 2024 17:22
@JKRhb JKRhb merged commit 0949b81 into main May 19, 2024
5 checks passed
@JKRhb JKRhb deleted the fix-consume-method branch May 19, 2024 17:24
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.

1 participant