VOL-1446 : Fix to prevent proxy callbacks from being wrongly used

- The fix consists in only assigning a proxy to a child node if
  the proxy of the parent points to the root folder "/"

Change-Id: I81fa9e0e142fb2a1fb885684026e2e2037144076
diff --git a/db/model/node.go b/db/model/node.go
index 20fd495..67848eb 100644
--- a/db/model/node.go
+++ b/db/model/node.go
@@ -123,10 +123,13 @@
 	if changeAnnouncement != nil && branch.Txid == "" {
 		if n.GetProxy() != nil {
 			for _, change := range changeAnnouncement {
-				log.Debugf("invoking callback - changeType: %+v, previous:%+v, latest: %+v",
-					change.Type,
-					change.PreviousData,
-					change.LatestData)
+				log.Debugw("invoking callback",
+					log.Fields{
+						"callbacks": n.GetProxy().getCallbacks(change.Type),
+						"type":change.Type,
+						"previousData": change.PreviousData,
+						"latestData": change.LatestData,
+					})
 				n.GetRoot().AddCallback(
 					n.GetProxy().InvokeCallbacks,
 					change.Type,
@@ -416,7 +419,8 @@
 			childNode := childRev.GetNode()
 
 			// Save proxy in child node to ensure callbacks are called later on
-			if childNode.Proxy == nil {
+			// only assign in cases of non sub-folder proxies, i.e. "/"
+			if childNode.Proxy == nil && n.Proxy != nil && n.Proxy.getFullPath() == "" {
 				childNode.Proxy = n.Proxy
 			}