Nextdoor / ndserviceregistry

Nextdoor ServiceRegistry Foundational Python Class
27 stars 12 forks source link

New children will not be detected in a non-existent path by a Watcher #38

Closed diranged closed 10 years ago

diranged commented 10 years ago

If you register a Watcher on /foo, and add new data to /foo at a later date, the Watcher detects this properly. However, if you add children to /foo, the Watcher detects the Data change but does not subsequently detect the children change.

This was intentional when the code was first written -- Kazoo throws a NoNodeException when you try to 'child-watch' a non-existent path. However, this could be worked around by initially not creating that ChildrenWatch on the non-existent path, and subsequently creating it when the 'data' for that path changes to something other than None.

diranged commented 10 years ago

The code in-question is here: https://github.com/Nextdoor/ndserviceregistry/blob/master/nd_service_registry/watcher.py#L148-L163