holepunch-hop 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "holepunch-hop",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "data interface to HOP",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/bees.js CHANGED
@@ -890,9 +890,14 @@ class HyperBee extends EventEmitter {
890
890
  for await (const { key, value } of nodeData) {
891
891
  resData.push({ key, value })
892
892
  }
893
- this.repPublicHolder[dataIn.discoverykey] = resData
894
- // notify peer repliate complete, ask if want save
895
- this.emit('publib-replicate-notification', { data: { text: 'public library replication complete', publib: dataIn.discoverykey }})
893
+ // data received?
894
+ if (resData.length > 0) {
895
+ this.repPublicHolder[dataIn.discoverykey] = resData
896
+ // notify peer repliate complete, ask if want save
897
+ this.emit('publib-replicate-notification', { data: { text: 'public library replication complete', publib: dataIn.discoverykey }})
898
+ } else {
899
+ this.emit('publib-replicate-notification', { data: { text: 'no data received', publib: dataIn.discoverykey }})
900
+ }
896
901
  }
897
902
 
898
903
  /**
package/src/peers.js CHANGED
@@ -281,8 +281,6 @@ class NetworkPeers extends EventEmitter {
281
281
  } else if (dataShareIn.type === 'private-cue-space') {
282
282
  this.emit('cuespace-notification', { publickey: peerMatch, data: dataShareIn })
283
283
  } else if (dataShareIn.type === 'public-library') {
284
- console.log('public rep reque arrivee')
285
- console.log(dataShareIn)
286
284
  this.emit('publiclibrarynotification', { publickey: peerMatch, data: dataShareIn })
287
285
  } else if (dataShareIn.type === 'peer') {
288
286
  } else if (dataShareIn.type === 'peer-codename-inform') {