@leofcoin/peernet 1.1.91 → 1.1.92

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.
@@ -1,4 +1,4 @@
1
- import { L as LittlePubSub } from './peernet-DwOQKkjc.js';
1
+ import { L as LittlePubSub } from './peernet-DKc812jS.js';
2
2
  import './identity-Cn0iQbY3.js';
3
3
  import './value-C3vAp-wb.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { F as FormatInterface } from './peernet-DwOQKkjc.js';
1
+ import { F as FormatInterface } from './peernet-DKc812jS.js';
2
2
  import './identity-Cn0iQbY3.js';
3
3
  import './value-C3vAp-wb.js';
4
4
 
@@ -8372,7 +8372,7 @@ class Peernet {
8372
8372
  this.root = options.root;
8373
8373
  const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
8374
8374
  // FolderMessageResponse
8375
- } = await import(/* webpackChunkName: "messages" */ './messages-PrGKIaCz.js');
8375
+ } = await import(/* webpackChunkName: "messages" */ './messages-BYZZUpuv.js');
8376
8376
  /**
8377
8377
  * proto Object containing protos
8378
8378
  * @type {Object}
@@ -8466,7 +8466,7 @@ class Peernet {
8466
8466
  if (this.#starting || this.#started)
8467
8467
  return;
8468
8468
  this.#starting = true;
8469
- const importee = await import('./client-CWo3zJ1j.js');
8469
+ const importee = await import('./client-Vbt0C3YZ.js');
8470
8470
  /**
8471
8471
  * @access public
8472
8472
  * @type {PeernetClient}
@@ -8725,10 +8725,11 @@ class Peernet {
8725
8725
  debug(`Error while requesting data from ${id}`, error);
8726
8726
  // if error, remove provider
8727
8727
  this.dht.removeProvider(id, hash);
8728
- if (this.#peerAttempts[id] > 3) {
8728
+ if (this.#peerAttempts[id] > 1) {
8729
8729
  this.#peerAttempts[id] = 0;
8730
8730
  debug(`Removed provider ${id} for ${hash} after 3 attempts`);
8731
- throw nothingFoundError(hash);
8731
+ console.error(nothingFoundError(hash));
8732
+ return undefined;
8732
8733
  }
8733
8734
  if (this.#peerAttempts[id] === undefined)
8734
8735
  this.#peerAttempts[id] = 0;
@@ -1,3 +1,3 @@
1
- export { P as default } from './peernet-DwOQKkjc.js';
1
+ export { P as default } from './peernet-DKc812jS.js';
2
2
  import './identity-Cn0iQbY3.js';
3
3
  import './value-C3vAp-wb.js';
@@ -806,10 +806,11 @@ class Peernet {
806
806
  debug(`Error while requesting data from ${id}`, error);
807
807
  // if error, remove provider
808
808
  this.dht.removeProvider(id, hash);
809
- if (this.#peerAttempts[id] > 3) {
809
+ if (this.#peerAttempts[id] > 1) {
810
810
  this.#peerAttempts[id] = 0;
811
811
  debug(`Removed provider ${id} for ${hash} after 3 attempts`);
812
- throw nothingFoundError(hash);
812
+ console.error(nothingFoundError(hash));
813
+ return undefined;
813
814
  }
814
815
  if (this.#peerAttempts[id] === undefined)
815
816
  this.#peerAttempts[id] = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leofcoin/peernet",
3
- "version": "1.1.91",
3
+ "version": "1.1.92",
4
4
  "description": "",
5
5
  "browser": "./exports/browser/peernet.js",
6
6
  "exports": {
package/src/peernet.ts CHANGED
@@ -584,10 +584,11 @@ export default class Peernet {
584
584
  debug(`Error while requesting data from ${id}`, error)
585
585
  // if error, remove provider
586
586
  this.dht.removeProvider(id, hash)
587
- if (this.#peerAttempts[id] > 3) {
587
+ if (this.#peerAttempts[id] > 1) {
588
588
  this.#peerAttempts[id] = 0
589
589
  debug(`Removed provider ${id} for ${hash} after 3 attempts`)
590
- throw nothingFoundError(hash)
590
+ console.error(nothingFoundError(hash))
591
+ return undefined
591
592
  }
592
593
 
593
594
  if (this.#peerAttempts[id] === undefined) this.#peerAttempts[id] = 0