hypercore 11.31.0 → 11.32.0

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/lib/core.js CHANGED
@@ -48,6 +48,7 @@ module.exports = class Core {
48
48
  this.globalCache = opts.globalCache || null
49
49
  this.autoClose = opts.autoClose !== false
50
50
  this.onidle = noop
51
+ this.ongroupupdate = noop
51
52
 
52
53
  this.state = null
53
54
  this.opened = false
package/lib/replicator.js CHANGED
@@ -2460,7 +2460,12 @@ module.exports = class Replicator {
2460
2460
  }
2461
2461
 
2462
2462
  this._onpeerupdate(false, peer)
2463
- if (inflight) this.updateAll()
2463
+ if (inflight) {
2464
+ this.updateAll()
2465
+ } else {
2466
+ this._checkUpgradeIfAvailable()
2467
+ this._maybeResolveIfAvailableRanges()
2468
+ }
2464
2469
  }
2465
2470
 
2466
2471
  _queueBlock(b) {
@@ -224,6 +224,7 @@ class SessionState {
224
224
 
225
225
  tx.deleteGroupUpdate(pointer, this.core.header.tree.timestamp)
226
226
  tx.putGroupUpdate(pointer, tree.timestamp, this.core.header.key)
227
+ this.core.ongroupupdate(this.core.header.group.key)
227
228
  }
228
229
 
229
230
  _clearActiveBatch() {
@@ -306,8 +307,6 @@ class SessionState {
306
307
  }
307
308
 
308
309
  if (this.isDefault() && this.core.header.group) {
309
- const { pointer } = this.core.header.group
310
-
311
310
  const tx = await this.createWriteBatch()
312
311
  this.updateGroupIndex(tx, tree)
313
312
  await tx.flush()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hypercore",
3
- "version": "11.31.0",
3
+ "version": "11.32.0",
4
4
  "description": "Hypercore is a secure, distributed append-only log",
5
5
  "main": "index.js",
6
6
  "scripts": {