Repository navigation
Conversation
react-native-zeroconf only supports one active scan, so far the last find() call replaced the previous scans and every result was reported to all callbacks, labelled with the callback's own type. The binding now keeps one browser per requested type: a new browser is started immediately, then all browsers take turns every 5s. Each result is only reported to the callbacks of the type it was found under (taken from the resolved full name, falling back to the active scan). This allows OpenBikeControl (_openbikecontrol._tcp) and Wahoo Direct Connect (_wahoo-fitness-tnp._tcp) discovery to coexist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
jonasbark
marked this pull request as ready for review
November 6, 2026 11:23
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Contributor
|
PLease use #481 instead |
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.



Companion to the OpenBikeControl PR in incyclist/devices (incyclist/devices#141). That PR adds a second mDNS search, for
_openbikecontrol._tcp, next to the Wahoo Direct Connect search.react-native-zeroconf only runs one scan at a time, so today the last
find()call replaces the earlier ones, and every result is passed to every callback labelled with that callback's own type. This change lets both searches coexist:Changes
src/bindings/direct-connect/mdns/binding.ts: one browser per requested type. A new browser starts immediately, then all browsers take turns every 5 s. Each result goes only to the callbacks of the type it was actually found under (taken from the resolvedfullName, falling back to the active scan). With a single type, nothing changes: one scan, no rotation.src/bindings/direct-connect/mdns/binding.test.ts: rotation, per-type delivery (iOS and AndroidfullNameformats), fallback, results without an address, disconnect.Testing
npx jest,npx eslint src/bindings/direct-connect/mdns/,npx tsc --noEmitThe devices change is safe with or without this one: without it, Direct Connect discovery on mobile works as before, but OpenBikeControl devices aren't found over Wi-Fi.