libp2r2p 0.10.25 → 0.10.26
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/README.md +13 -0
- package/package.json +2 -2
- package/relay/services/relay-pool.js +3 -4
package/README.md
CHANGED
|
@@ -854,3 +854,16 @@ A stale token cannot acknowledge a newly reserved or replaced record.
|
|
|
854
854
|
|
|
855
855
|
`queue.getCapacity()` returns `{ usedBytes, maxBytes }`; capacity rejections
|
|
856
856
|
also expose `requiredBytes` and `maxBytes`, without retaining the rejected item.
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
### Publication acknowledgement deadlines
|
|
860
|
+
|
|
861
|
+
`RelayPool.sendEvent` returns immediately when the first relay accepts an event,
|
|
862
|
+
when all relays fail, or when the operation's `timeout` expires (30 seconds by
|
|
863
|
+
default, including connection work). `timeoutUntilFirstFulfillment` now defaults
|
|
864
|
+
to `null`, removing the former 3-second cutoff. Explicit shorter deadlines remain
|
|
865
|
+
supported and still finalize pending reports as timeouts. `promise` provides the
|
|
866
|
+
complete per-relay report without delaying the first-success return. Connection
|
|
867
|
+
establishment retains its separate 3-second deadline. PrivateMessenger inherits
|
|
868
|
+
this publication policy, including seeder/recovery messages. A timeout indicates
|
|
869
|
+
missing acknowledgement and cannot prove that the recipient did not receive it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libp2r2p",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.26",
|
|
4
4
|
"description": "Peer-to-relay-to-peer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"p2r2p",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"@noble/curves": "2.2.0",
|
|
98
98
|
"@noble/hashes": "2.2.0",
|
|
99
99
|
"@scure/base": "2.0.0",
|
|
100
|
-
"nmmr": "2.0.
|
|
100
|
+
"nmmr": "2.0.1"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
103
|
"eslint": "^9.39.5",
|
|
@@ -11,7 +11,6 @@ import { RelayConnection } from './relay-connection.js'
|
|
|
11
11
|
const CONNECTION_TIMEOUT_MS = 3000
|
|
12
12
|
const COUNT_TIMEOUT_MS = 5000
|
|
13
13
|
const COUNT_TIMEOUT_AFTER_FIRST_COUNT_MS = 500
|
|
14
|
-
const SEND_TIMEOUT_UNTIL_FIRST_FULFILLMENT_MS = 3000
|
|
15
14
|
const SEND_TIMEOUT_MS = 30000
|
|
16
15
|
const LIVE_OVERLAP_SECONDS = 600
|
|
17
16
|
const LIVE_PROGRESS_INTERVAL_MS = 60000
|
|
@@ -1120,8 +1119,8 @@ export class RelayPool {
|
|
|
1120
1119
|
}
|
|
1121
1120
|
}
|
|
1122
1121
|
|
|
1123
|
-
// Returns
|
|
1124
|
-
//
|
|
1122
|
+
// Returns on the first acknowledgement, all failures, or the 30s deadline.
|
|
1123
|
+
// An optional timeoutUntilFirstFulfillment imposes an earlier deadline on this
|
|
1125
1124
|
// initial return and closes pending reports when it fails. null disables either
|
|
1126
1125
|
// timer independently. onRelayResult receives one
|
|
1127
1126
|
// { relay, success, outcome, reason? } result per relay as it settles; outcome
|
|
@@ -1130,7 +1129,7 @@ export class RelayPool {
|
|
|
1130
1129
|
// Await `promise` for the complete report, including every relay outcome.
|
|
1131
1130
|
async sendEvent (event, relays, {
|
|
1132
1131
|
timeout = SEND_TIMEOUT_MS,
|
|
1133
|
-
timeoutUntilFirstFulfillment =
|
|
1132
|
+
timeoutUntilFirstFulfillment = null,
|
|
1134
1133
|
getAuthEvent,
|
|
1135
1134
|
onRelayResult
|
|
1136
1135
|
} = {}) {
|