-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add ability to update TXTRecord #152
Conversation
Also tested on Raspberry Pi + Raspbian Jessie |
Awesome! Thanks. I believe this is the first new feature in ... a very long time gesture. ;) I'm going to review the code and will comment inline. Could you look into writing a small test for this? |
@@ -162,4 +162,54 @@ NAN_METHOD(DNSServiceRegister) { | |||
} | |||
} | |||
|
|||
NAN_METHOD(DNSServiceUpdateRecord) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this to its own file for consistency?
(I know it's odd and I wouldn't do it again... but that's how it is...)
I'm done with my review. Let me know what you think. |
@agnat sounds great. For test case, where do you want I put that? In the same file as |
Well, the test goes into the
|
@agnat added the test case. Not sure if there is a way to detect txtRecord update programmatically. |
Actually, I'd prefer a real functional test:
... assuming existing browsers don't get notified when the txt record changes. |
@agnat Yeah, it appears that browser won't emit serviceChanged event when txt record changes. I updated the test. |
Awesome, thanks. There still is the issue with the fixed |
Oops that's awkward... I missed that when copying the arguments 😅 Should be good now? |
Yes, indeed. Please squash your commits and we are ready to roll. Oh, and if you like add yourself to the contributors sections in the |
adopt reviewer's suggestions. add test Update test case Fix accessing the wrong elements from the array. Update contributors
Done. |
Unfortunately the test fails:
It probably is something simple. Could you look into it and do a quick follow-up PR? |
It appears that calling I can fix the test case by adding a variable to check if the callback has been invoked or I can modify advertisement.js to make sure And for
|
Hm, I see... kind of.
Right. But it does seem reasonable...
I'm not sure yet. I think I prefer not to interfere with the callbacks. Since it only modifies the behavior if you use the new API function it's ok I guess. So, just trap it in the test for now. Regarding the potential timing issue: Let's fix the callback chaos first and then take it from there. I'm going to revert the merge. That way you can keep working on the same branch. |
Forget that. I keep forgetting how the revert stuff works... Just create a new PR. ;) |
Add the ability to update mDNS Advertisement TXTRecord via DNSServiceUpdateRecord.
Currently only tested on OS X 10.10.2