autobee 2.5.3 → 2.5.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.
Files changed (2) hide show
  1. package/index.js +8 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -206,7 +206,7 @@ module.exports = class Autobee extends ReadyResource {
206
206
 
207
207
  async _updateAcking() {
208
208
  if (this._interrupting) return
209
- this.setAcking(await this.trusted.isTrusted(this.local.key, this.view))
209
+ this.setAcking(await this.trusted.isTrusted(this.local.key, this._workingView.view))
210
210
  }
211
211
 
212
212
  // network free: only a migration needs peers, so ready() awaits the full
@@ -290,7 +290,7 @@ module.exports = class Autobee extends ReadyResource {
290
290
  if (local) {
291
291
  result.writers.push(this.local.key)
292
292
 
293
- if (await this.trusted.isTrusted(this.local.key, this.view)) {
293
+ if (await this.trusted.isTrusted(this.local.key, this._workingView.view)) {
294
294
  const localViews = await this.writers.localWriter.views()
295
295
  for (const { key } of localViews) {
296
296
  views.set(b4a.toString(key, 'hex'), key)
@@ -314,6 +314,12 @@ module.exports = class Autobee extends ReadyResource {
314
314
  result.writers.push(head.key)
315
315
  }
316
316
 
317
+ // nothing trusted to anchor on: pin the bootstrap so a mirror still
318
+ // has a bootable entrypoint for this room
319
+ if (views.size === 0 && !b4a.equals(this.bootstrap.key, this.local.key)) {
320
+ result.writers.push(this.bootstrap.key)
321
+ }
322
+
317
323
  if (all) {
318
324
  const [viewCores, systemCores] = await Promise.all([
319
325
  this.bee.cores({ local: false }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autobee",
3
- "version": "2.5.3",
3
+ "version": "2.5.5",
4
4
  "description": "Bee based autobase",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Holepunch Inc.",