@kumiai/hub-tunnel 0.10.1 → 0.10.3
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/events.d.ts +1 -1
- package/lib/transport.d.ts +2 -0
- package/lib/transport.js +4 -1
- package/package.json +8 -8
package/lib/events.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DecryptError, EnvelopeDecodeError } from './errors.js';
|
|
2
|
-
export type FrameDroppedReason = 'envelope-decode' | 'decrypt' | 'group-mismatch' | 'topic-mismatch' | 'session-mismatch' | 'dedup';
|
|
2
|
+
export type FrameDroppedReason = 'envelope-decode' | 'decrypt' | 'group-mismatch' | 'topic-mismatch' | 'session-mismatch' | 'stale-session-end' | 'dedup';
|
|
3
3
|
export type ObservabilityEvent = {
|
|
4
4
|
type: 'decrypt-failed';
|
|
5
5
|
error: DecryptError;
|
package/lib/transport.d.ts
CHANGED
|
@@ -88,6 +88,8 @@ export type HubFetchTopicResult = {
|
|
|
88
88
|
head: string | null;
|
|
89
89
|
/** The oldest sequenceID still retained, or null if the log is empty. */
|
|
90
90
|
oldest: string | null;
|
|
91
|
+
/** Removed log frames after the exclusive cursor, from the same snapshot as messages and head. */
|
|
92
|
+
gap: boolean;
|
|
91
93
|
};
|
|
92
94
|
/**
|
|
93
95
|
* The APIs both hub kinds share — everything except how you publish. `events` are
|
package/lib/transport.js
CHANGED
|
@@ -210,9 +210,12 @@ const DEFAULT_INBOX_CAPACITY = 1024;
|
|
|
210
210
|
if (lockedSessionID == null) {
|
|
211
211
|
lockedSessionID = frame.sessionID;
|
|
212
212
|
} else if (frame.sessionID !== lockedSessionID) {
|
|
213
|
+
// A peer that ends a session and at once dials again can receive the other side's
|
|
214
|
+
// session-end for the old session after the new one has locked. That is benign and
|
|
215
|
+
// distinct from frames of a foreign session reaching this consumer.
|
|
213
216
|
onEvent?.({
|
|
214
217
|
type: 'frame-dropped',
|
|
215
|
-
reason: 'session-mismatch'
|
|
218
|
+
reason: frame.kind === 'session-end' ? 'stale-session-end' : 'session-mismatch'
|
|
216
219
|
});
|
|
217
220
|
continue;
|
|
218
221
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kumiai/hub-tunnel",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "Peer-to-peer Enkaku transport tunneled through a hub relay",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"enkaku",
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@enkaku/transport": "^0.21.3",
|
|
30
|
-
"@kumiai/hub-protocol": "^0.10.
|
|
31
|
-
"@sozai/async": "^0.
|
|
32
|
-
"@sozai/codec": "^0.4.
|
|
33
|
-
"@sozai/event": "^0.1.
|
|
34
|
-
"@sozai/schema": "^0.1.
|
|
30
|
+
"@kumiai/hub-protocol": "^0.10.1",
|
|
31
|
+
"@sozai/async": "^0.4.0",
|
|
32
|
+
"@sozai/codec": "^0.4.2",
|
|
33
|
+
"@sozai/event": "^0.1.5",
|
|
34
|
+
"@sozai/schema": "^0.1.6"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@enkaku/client": "^0.21.3",
|
|
38
|
-
"@enkaku/protocol": "^0.21.
|
|
38
|
+
"@enkaku/protocol": "^0.21.4",
|
|
39
39
|
"@enkaku/server": "^0.21.3",
|
|
40
40
|
"@kokuin/token": "^0.5.0",
|
|
41
|
-
"@kumiai/hub-conformance": "^0.10.
|
|
41
|
+
"@kumiai/hub-conformance": "^0.10.1"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|