Handle Service types that end with another service type#1041
Merged
Conversation
bdraco
requested changes
Dec 23, 2021
Member
bdraco
left a comment
There was a problem hiding this comment.
Looks like a good fix. Please add a test for this case.
Thanks 👍
bdraco
reviewed
Dec 23, 2021
Member
|
Looks like we don't handle subtypes correctly |
Member
|
That test is wrong. Its passing the registration name instead of the type |
Codecov Report
@@ Coverage Diff @@
## master #1041 +/- ##
==========================================
- Coverage 99.88% 99.88% -0.01%
==========================================
Files 23 23
Lines 2542 2538 -4
Branches 472 470 -2
==========================================
- Hits 2539 2535 -4
Misses 3 3
Continue to review full report at Codecov.
|
Fixes erroneous match with service names that have a type that ends with a shorter type. Given "%NAS._asustor-looksgood_http._tcp.local.", type "_asustor-looksgood_http._tcp.local." should not match "_http._tcp.local."
Member
|
I fixed the subtypes not being matched correctly. We still do need a test for the original issue |
bdraco
approved these changes
Dec 24, 2021
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.
Fixes erroneous match with service names that have a type that ends with a shorter type.
Given "%NAS._asustor-looksgood_http._tcp.local.",
type "_asustor-looksgood_http._tcp.local." should not match "_http._tcp.local."
My example: currently with an Asustor NAS the "%NAS._asustor-looksgood_http._tcp.local." service appears to have a "_http._tcp.local." service_type while its actual type is "_asustor-looksgood_http._tcp.local."
This causes an exception because the ServiceInfo init checks:
Fixes #1040