@quereus/sync-client 4.3.1 → 4.4.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/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/sync-client.d.ts +65 -2
- package/dist/src/sync-client.d.ts.map +1 -1
- package/dist/src/sync-client.js +251 -33
- package/dist/src/sync-client.js.map +1 -1
- package/dist/src/types.d.ts +0 -98
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +5 -0
- package/dist/src/types.js.map +1 -1
- package/package.json +5 -4
- package/dist/src/serialization.d.ts +0 -40
- package/dist/src/serialization.d.ts.map +0 -1
- package/dist/src/serialization.js +0 -157
- package/dist/src/serialization.js.map +0 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* @packageDocumentation
|
|
27
27
|
*/
|
|
28
28
|
export { SyncClient } from './sync-client.js';
|
|
29
|
-
export { serializeChangeSet, deserializeChangeSet, serializeHLCForTransport, deserializeHLCFromTransport, } from '
|
|
30
|
-
export type {
|
|
29
|
+
export { serializeChangeSet, deserializeChangeSet, serializeHLCForTransport, deserializeHLCFromTransport, } from '@quereus/sync';
|
|
30
|
+
export type { SerializedChangeSet, SerializedChange, SerializedSchemaMigration, ClientMessage, ServerMessage, HandshakeMessage, HandshakeAckMessage, GetChangesMessage, ChangesMessage, PushChangesMessage, ApplyChangesMessage, ApplyResultMessage, GetSnapshotMessage, PingMessage, PongMessage, ErrorMessage, } from '@quereus/sync';
|
|
31
|
+
export type { SyncStatus, SyncEvent, SyncEventType, SyncClientOptions, } from './types.js';
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EAEzB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,eAAe,CAAC;AAGvB,YAAY,EACV,UAAU,EACV,SAAS,EACT,aAAa,EACb,iBAAiB,GAClB,MAAM,YAAY,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -26,5 +26,8 @@
|
|
|
26
26
|
* @packageDocumentation
|
|
27
27
|
*/
|
|
28
28
|
export { SyncClient } from './sync-client.js';
|
|
29
|
-
|
|
29
|
+
// The wire codec and message/Serialized types now live in @quereus/sync (the
|
|
30
|
+
// single source of truth shared with the coordinator). Re-export them here so the
|
|
31
|
+
// client's public API is unchanged for existing consumers.
|
|
32
|
+
export { serializeChangeSet, deserializeChangeSet, serializeHLCForTransport, deserializeHLCFromTransport, } from '@quereus/sync';
|
|
30
33
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,6EAA6E;AAC7E,kFAAkF;AAClF,2DAA2D;AAC3D,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,eAAe,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Message dispatch (changes, push_changes, apply_result, error, pong)
|
|
7
7
|
* - Reconnection with exponential backoff
|
|
8
8
|
* - Local change debouncing
|
|
9
|
-
* - Delta sync tracking (lastSentHLC
|
|
9
|
+
* - Delta sync tracking (lastSentHLC + per-request pending watermarks)
|
|
10
10
|
*/
|
|
11
11
|
import type { SyncClientOptions, SyncStatus } from './types.js';
|
|
12
12
|
/**
|
|
@@ -28,8 +28,17 @@ export declare class SyncClient {
|
|
|
28
28
|
private reconnectAttempts;
|
|
29
29
|
private reconnectTimer;
|
|
30
30
|
private intentionalDisconnect;
|
|
31
|
+
private stopReconnect;
|
|
32
|
+
/**
|
|
33
|
+
* Server error codes that are fatal even when the server does not send the
|
|
34
|
+
* `fatal` flag (coordinators predating it). These correspond to sendError
|
|
35
|
+
* calls where the coordinator also closes the socket or leaves the session
|
|
36
|
+
* unrecoverable, so reconnecting as-is cannot succeed.
|
|
37
|
+
*/
|
|
38
|
+
private static readonly FATAL_ERROR_CODES;
|
|
31
39
|
private lastSentHLC;
|
|
32
|
-
private
|
|
40
|
+
private readonly pendingSentHLCs;
|
|
41
|
+
private applyRequestSeq;
|
|
33
42
|
private debounceTimer;
|
|
34
43
|
private pendingLocalChangeCount;
|
|
35
44
|
private localChangeUnsubscribe;
|
|
@@ -60,16 +69,70 @@ export declare class SyncClient {
|
|
|
60
69
|
*/
|
|
61
70
|
disconnect(): Promise<void>;
|
|
62
71
|
private handleMessage;
|
|
72
|
+
/**
|
|
73
|
+
* Handle a server `error` message.
|
|
74
|
+
*
|
|
75
|
+
* Default behavior keeps the session alive: a per-request (transient) error
|
|
76
|
+
* is surfaced but does not stop the connection or its auto-reconnect. Only a
|
|
77
|
+
* fatal error (server rejected the session and typically closed the socket)
|
|
78
|
+
* flips `stopReconnect` and puts the client into a lasting `error` status.
|
|
79
|
+
*/
|
|
80
|
+
private handleServerError;
|
|
63
81
|
private handleHandshakeAck;
|
|
82
|
+
/**
|
|
83
|
+
* Apply received changesets to the local store, optionally advancing the
|
|
84
|
+
* received watermark (`lastSyncHLC`).
|
|
85
|
+
*
|
|
86
|
+
* @param advanceWatermark Only the ordered `changes` reply is contiguous and
|
|
87
|
+
* gap-free, so only it may advance the watermark. A `push_changes`
|
|
88
|
+
* broadcast is applied (idempotently) but must leave the watermark unmoved,
|
|
89
|
+
* so a broadcast the client never received is still redelivered by the next
|
|
90
|
+
* `get_changes sinceHLC=<watermark>`.
|
|
91
|
+
*/
|
|
64
92
|
private handleChanges;
|
|
65
93
|
private handleApplyResult;
|
|
94
|
+
/**
|
|
95
|
+
* Advance `lastSentHLC` for the acknowledged push identified by `requestId`.
|
|
96
|
+
*
|
|
97
|
+
* Only the push whose id we recorded in {@link pushLocalChanges} promotes the
|
|
98
|
+
* watermark, and only ever forward — never regressing past a newer batch a
|
|
99
|
+
* later ack already promoted. Acks we can't correlate are dropped:
|
|
100
|
+
* - a `requestId` we don't hold → a stale or duplicate ack (e.g. redelivered
|
|
101
|
+
* across a reconnect, or the server double-acked); logged, then ignored.
|
|
102
|
+
* - no `requestId` → an untracked push (a peer-relay `apply_changes`) or a
|
|
103
|
+
* legacy coordinator that doesn't echo the id; nothing to promote.
|
|
104
|
+
*/
|
|
105
|
+
private promoteWatermark;
|
|
66
106
|
private handleRequestChanges;
|
|
67
107
|
private sendHandshake;
|
|
68
108
|
private requestChangesFromServer;
|
|
109
|
+
/**
|
|
110
|
+
* Seed `lastSentHLC` from the durable per-peer sent watermark. Called on every
|
|
111
|
+
* handshake so a fresh process resumes delta-push from the last confirmed HLC
|
|
112
|
+
* rather than re-sending its whole local history.
|
|
113
|
+
*
|
|
114
|
+
* Takes the persisted value only when it is ahead of the in-memory one, so an
|
|
115
|
+
* auto-reconnect that still holds an advanced in-memory watermark (its
|
|
116
|
+
* in-flight pushes may have promoted memory past the last durable write) is
|
|
117
|
+
* never dragged backward.
|
|
118
|
+
*/
|
|
119
|
+
private seedSentWatermark;
|
|
120
|
+
/**
|
|
121
|
+
* Send a message to the server.
|
|
122
|
+
*
|
|
123
|
+
* @returns true if the bytes were handed to the socket, false if the send was
|
|
124
|
+
* dropped (socket not open) or threw. Callers that advance state on a
|
|
125
|
+
* send (e.g. the delta-sync watermark) must check this — a dropped
|
|
126
|
+
* send is not success.
|
|
127
|
+
*/
|
|
69
128
|
private send;
|
|
129
|
+
/** Detach a socket's event handlers so it can no longer drive this client. */
|
|
130
|
+
private detachSocketHandlers;
|
|
70
131
|
private subscribeToLocalChanges;
|
|
71
132
|
private debouncePushLocalChanges;
|
|
72
133
|
private pushLocalChanges;
|
|
134
|
+
/** Next monotonic apply-request id. Deterministic for test predictability. */
|
|
135
|
+
private nextApplyRequestId;
|
|
73
136
|
private scheduleReconnect;
|
|
74
137
|
private clearReconnectTimer;
|
|
75
138
|
private clearDebounceTimer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-client.d.ts","sourceRoot":"","sources":["../../src/sync-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"sync-client.d.ts","sourceRoot":"","sources":["../../src/sync-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoBH,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EAEX,MAAM,YAAY,CAAC;AAOpB;;;;;GAKG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW,CA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AC,iBAAiB;YAuBX,kBAAkB;IA4DhC;;;;;;;;;OASG;YACW,aAAa;YAgCb,iBAAiB;IAgB/B;;;;;;;;;;OAUG;YACW,gBAAgB;YAkChB,oBAAoB;IAqBlC,OAAO,CAAC,aAAa;YAaP,wBAAwB;IAYtC;;;;;;;;;OASG;YACW,iBAAiB;IAQ/B;;;;;;;OAOG;IACH,OAAO,CAAC,IAAI;IAkBZ,8EAA8E;IAC9E,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,wBAAwB;YASlB,gBAAgB;IA4C9B,8EAA8E;IAC9E,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,aAAa;CAatB"}
|
package/dist/src/sync-client.js
CHANGED
|
@@ -6,10 +6,9 @@
|
|
|
6
6
|
* - Message dispatch (changes, push_changes, apply_result, error, pong)
|
|
7
7
|
* - Reconnection with exponential backoff
|
|
8
8
|
* - Local change debouncing
|
|
9
|
-
* - Delta sync tracking (lastSentHLC
|
|
9
|
+
* - Delta sync tracking (lastSentHLC + per-request pending watermarks)
|
|
10
10
|
*/
|
|
11
|
-
import { siteIdToBase64, siteIdFromBase64, maxHLC, } from '@quereus/sync';
|
|
12
|
-
import { serializeChangeSet, deserializeChangeSet, serializeHLCForTransport, deserializeHLCFromTransport, } from './serialization.js';
|
|
11
|
+
import { siteIdToBase64, siteIdFromBase64, maxHLC, compareHLC, serializeChangeSet, deserializeChangeSet, serializeHLCForTransport, deserializeHLCFromTransport, PROTOCOL_VERSION, } from '@quereus/sync';
|
|
13
12
|
// Default configuration values
|
|
14
13
|
const DEFAULT_RECONNECT_DELAY_MS = 1000;
|
|
15
14
|
const DEFAULT_MAX_RECONNECT_DELAY_MS = 60_000;
|
|
@@ -35,10 +34,44 @@ export class SyncClient {
|
|
|
35
34
|
// Reconnection state
|
|
36
35
|
reconnectAttempts = 0;
|
|
37
36
|
reconnectTimer = null;
|
|
37
|
+
// True only when the client itself called disconnect(). Never set by a
|
|
38
|
+
// server error — see stopReconnect for server-driven shutdown.
|
|
38
39
|
intentionalDisconnect = false;
|
|
39
|
-
//
|
|
40
|
+
// True when the server told us to stop reconnecting (a fatal error). Kept
|
|
41
|
+
// separate from intentionalDisconnect so a transient server error can never
|
|
42
|
+
// masquerade as a deliberate client disconnect.
|
|
43
|
+
stopReconnect = false;
|
|
44
|
+
/**
|
|
45
|
+
* Server error codes that are fatal even when the server does not send the
|
|
46
|
+
* `fatal` flag (coordinators predating it). These correspond to sendError
|
|
47
|
+
* calls where the coordinator also closes the socket or leaves the session
|
|
48
|
+
* unrecoverable, so reconnecting as-is cannot succeed.
|
|
49
|
+
*/
|
|
50
|
+
static FATAL_ERROR_CODES = new Set([
|
|
51
|
+
'AUTH_FAILED',
|
|
52
|
+
'MISSING_DATABASE_ID',
|
|
53
|
+
'ALREADY_AUTHENTICATED',
|
|
54
|
+
]);
|
|
55
|
+
// Delta sync tracking. `lastSentHLC` is the high-water mark of local changes
|
|
56
|
+
// the server has acknowledged. It is durably persisted per peer on each
|
|
57
|
+
// confirmed ack (SyncManager.updatePeerSentState) and re-seeded on handshake,
|
|
58
|
+
// so a process restart resumes delta-push instead of replaying local history.
|
|
59
|
+
// Each in-flight push is tracked by its request id → the HLC that ack would
|
|
60
|
+
// promote `lastSentHLC` to; keying by request id correlates each
|
|
61
|
+
// `apply_result` to the exact batch that produced it, so a stale, duplicate,
|
|
62
|
+
// or out-of-order ack can't mis-advance the watermark.
|
|
40
63
|
lastSentHLC = null;
|
|
41
|
-
|
|
64
|
+
// NOTE: bounded by in-flight pushes — every successful ack prunes itself plus
|
|
65
|
+
// any batch its watermark subsumes (see promoteWatermark), and disconnect
|
|
66
|
+
// clears it. If a server ever accepts apply_changes but never acks them, this
|
|
67
|
+
// would grow one entry per push; cap it (evict oldest) only if that shows up.
|
|
68
|
+
pendingSentHLCs = new Map();
|
|
69
|
+
// Monotonic per-client counter backing apply-request ids. Deterministic (no
|
|
70
|
+
// Date.now / Math.random) so tests can predict the ids. Intentionally NOT
|
|
71
|
+
// reset on disconnect: pendingSentHLCs is cleared there instead, so a stale
|
|
72
|
+
// ack redelivered after a reconnect carries an id we no longer hold (dropped)
|
|
73
|
+
// rather than colliding with a freshly-reused id and crediting the wrong batch.
|
|
74
|
+
applyRequestSeq = 0;
|
|
42
75
|
// Local change debouncing
|
|
43
76
|
debounceTimer = null;
|
|
44
77
|
pendingLocalChangeCount = 0;
|
|
@@ -86,12 +119,16 @@ export class SyncClient {
|
|
|
86
119
|
this.connectionDatabaseId = databaseId;
|
|
87
120
|
this.connectionToken = token;
|
|
88
121
|
this.intentionalDisconnect = false;
|
|
122
|
+
this.stopReconnect = false;
|
|
89
123
|
// Clear any pending reconnect timer
|
|
90
124
|
this.clearReconnectTimer();
|
|
91
125
|
// Abandon any prior unsettled connect promise
|
|
92
126
|
this.settleConnect(new Error('Superseded by new connect() call'));
|
|
93
|
-
// Close existing connection
|
|
127
|
+
// Close existing connection. Detach its handlers first so a late event
|
|
128
|
+
// from the dead socket (e.g. its deferred onclose) can't drive this client
|
|
129
|
+
// — only the live socket should.
|
|
94
130
|
if (this.ws) {
|
|
131
|
+
this.detachSocketHandlers(this.ws);
|
|
95
132
|
this.ws.close();
|
|
96
133
|
this.ws = null;
|
|
97
134
|
}
|
|
@@ -100,8 +137,7 @@ export class SyncClient {
|
|
|
100
137
|
this._connectResolve = resolve;
|
|
101
138
|
this._connectReject = reject;
|
|
102
139
|
try {
|
|
103
|
-
|
|
104
|
-
this.ws = new WebSocket(wsUrl);
|
|
140
|
+
this.ws = new WebSocket(url);
|
|
105
141
|
this.ws.onopen = () => {
|
|
106
142
|
this.reconnectAttempts = 0;
|
|
107
143
|
this.sendHandshake(databaseId, token);
|
|
@@ -169,14 +205,19 @@ export class SyncClient {
|
|
|
169
205
|
this.localChangeUnsubscribe();
|
|
170
206
|
this.localChangeUnsubscribe = null;
|
|
171
207
|
}
|
|
172
|
-
// Close WebSocket
|
|
208
|
+
// Close WebSocket. Detach handlers first so its deferred onclose can't
|
|
209
|
+
// fire back into the client after we've torn down.
|
|
173
210
|
if (this.ws) {
|
|
211
|
+
this.detachSocketHandlers(this.ws);
|
|
174
212
|
this.ws.close();
|
|
175
213
|
this.ws = null;
|
|
176
214
|
}
|
|
177
215
|
this.serverSiteId = null;
|
|
216
|
+
// Clear only the in-memory watermark. The persisted per-peer sent watermark
|
|
217
|
+
// (SyncManager.updatePeerSentState) is intentionally left intact so a later
|
|
218
|
+
// reconnect resumes delta-push instead of replaying local history.
|
|
178
219
|
this.lastSentHLC = null;
|
|
179
|
-
this.
|
|
220
|
+
this.pendingSentHLCs.clear();
|
|
180
221
|
this.setStatus({ status: 'disconnected' });
|
|
181
222
|
this.emitSyncEvent('state-change', 'Disconnected from sync server (manual)');
|
|
182
223
|
}
|
|
@@ -190,20 +231,24 @@ export class SyncClient {
|
|
|
190
231
|
await this.handleHandshakeAck(message);
|
|
191
232
|
break;
|
|
192
233
|
case 'changes':
|
|
234
|
+
// Ordered reply to an explicit get_changes: server-ordered, gap-free.
|
|
235
|
+
// Safe to advance the received watermark.
|
|
236
|
+
await this.handleChanges(message.changeSets || [], true);
|
|
237
|
+
break;
|
|
193
238
|
case 'push_changes':
|
|
194
|
-
|
|
239
|
+
// Fire-and-forget broadcast relaying a peer's change. Delivery is not
|
|
240
|
+
// acked, so a dropped broadcast is invisible to the coordinator. Apply
|
|
241
|
+
// it eagerly, but do NOT advance the watermark — otherwise a missed
|
|
242
|
+
// earlier broadcast would never be redelivered on the next catch-up.
|
|
243
|
+
// The change is re-fetched (and idempotently re-applied) by the next
|
|
244
|
+
// get_changes since the watermark stays below it.
|
|
245
|
+
await this.handleChanges(message.changeSets || [], false);
|
|
195
246
|
break;
|
|
196
247
|
case 'apply_result':
|
|
197
|
-
this.handleApplyResult(message);
|
|
248
|
+
await this.handleApplyResult(message);
|
|
198
249
|
break;
|
|
199
250
|
case 'error':
|
|
200
|
-
this.
|
|
201
|
-
this.options.onError?.(new Error(message.message));
|
|
202
|
-
// Server explicitly rejected — stop auto-reconnect to avoid tight loops.
|
|
203
|
-
// The caller's retry mechanism (with its own backoff) will handle retrying.
|
|
204
|
-
this.intentionalDisconnect = true;
|
|
205
|
-
this.setStatus({ status: 'error', message: message.message });
|
|
206
|
-
this.settleConnect(new Error(message.message));
|
|
251
|
+
this.handleServerError(message);
|
|
207
252
|
break;
|
|
208
253
|
case 'pong':
|
|
209
254
|
// Heartbeat response - no action needed
|
|
@@ -221,7 +266,61 @@ export class SyncClient {
|
|
|
221
266
|
}
|
|
222
267
|
}
|
|
223
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* Handle a server `error` message.
|
|
271
|
+
*
|
|
272
|
+
* Default behavior keeps the session alive: a per-request (transient) error
|
|
273
|
+
* is surfaced but does not stop the connection or its auto-reconnect. Only a
|
|
274
|
+
* fatal error (server rejected the session and typically closed the socket)
|
|
275
|
+
* flips `stopReconnect` and puts the client into a lasting `error` status.
|
|
276
|
+
*/
|
|
277
|
+
handleServerError(message) {
|
|
278
|
+
// Always surface the error to listeners.
|
|
279
|
+
this.emitSyncEvent('error', `Server error: ${message.message} (${message.code})`);
|
|
280
|
+
this.options.onError?.(new Error(message.message));
|
|
281
|
+
// Trust the server's `fatal` flag when present; fall back to the known
|
|
282
|
+
// fatal-code set for coordinators that predate it.
|
|
283
|
+
const fatal = message.fatal ?? SyncClient.FATAL_ERROR_CODES.has(message.code);
|
|
284
|
+
if (fatal) {
|
|
285
|
+
// Unrecoverable — a bare reconnect would just fail again. Stop reconnect
|
|
286
|
+
// and settle any pending connect(). Note: NOT intentionalDisconnect,
|
|
287
|
+
// which means only "the client called disconnect()".
|
|
288
|
+
this.stopReconnect = true;
|
|
289
|
+
this.setStatus({ status: 'error', message: message.message });
|
|
290
|
+
this.settleConnect(new Error(message.message));
|
|
291
|
+
}
|
|
292
|
+
// Transient: keep the connection and auto-reconnect intact. Deliberately do
|
|
293
|
+
// not set a lingering 'error' status — a per-request failure shouldn't
|
|
294
|
+
// masquerade as connection death (onclose keys its disconnected transition
|
|
295
|
+
// off status === 'error').
|
|
296
|
+
}
|
|
224
297
|
async handleHandshakeAck(message) {
|
|
298
|
+
// Wire-version gate. A coordinator on a different protocol version — or one
|
|
299
|
+
// predating versioning, so the ack carries none — would silently
|
|
300
|
+
// misinterpret us. Treat any mismatch (strict equality; absent counts as
|
|
301
|
+
// mismatch) as fatal: stop reconnecting, surface a lasting error, and reject
|
|
302
|
+
// the pending connect(). Reuses the same stop-reconnect path as a fatal
|
|
303
|
+
// server error, so auto-reconnect does not resume.
|
|
304
|
+
if (message.protocolVersion !== PROTOCOL_VERSION) {
|
|
305
|
+
const serverPart = message.protocolVersion === undefined
|
|
306
|
+
? 'server sent none (pre-versioning coordinator)'
|
|
307
|
+
: `server speaks v${message.protocolVersion}`;
|
|
308
|
+
const errMsg = `Sync protocol version mismatch: client speaks v${PROTOCOL_VERSION}, ${serverPart}`;
|
|
309
|
+
this.stopReconnect = true;
|
|
310
|
+
this.setStatus({ status: 'error', message: errMsg });
|
|
311
|
+
this.emitSyncEvent('error', errMsg);
|
|
312
|
+
this.options.onError?.(new Error(errMsg));
|
|
313
|
+
this.settleConnect(new Error(errMsg));
|
|
314
|
+
// Drop the incompatible socket. Detach first so its deferred onclose can't
|
|
315
|
+
// fire back into the client (scheduleReconnect is already guarded by
|
|
316
|
+
// stopReconnect, but we don't want the disconnected-status churn either).
|
|
317
|
+
if (this.ws) {
|
|
318
|
+
this.detachSocketHandlers(this.ws);
|
|
319
|
+
this.ws.close();
|
|
320
|
+
this.ws = null;
|
|
321
|
+
}
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
225
324
|
if (message.serverSiteId) {
|
|
226
325
|
this.serverSiteId = siteIdFromBase64(message.serverSiteId);
|
|
227
326
|
}
|
|
@@ -230,6 +329,10 @@ export class SyncClient {
|
|
|
230
329
|
this.settleConnect();
|
|
231
330
|
// Request changes from server since our last sync with this peer
|
|
232
331
|
await this.requestChangesFromServer();
|
|
332
|
+
// Seed the sent watermark from durable per-peer state so a fresh process
|
|
333
|
+
// (or a reconnect) resumes delta-push where it left off instead of
|
|
334
|
+
// replaying the entire local history to the server.
|
|
335
|
+
await this.seedSentWatermark();
|
|
233
336
|
// In read-only (pull-only) mode, skip push entirely
|
|
234
337
|
if (!this.options.readOnly) {
|
|
235
338
|
// Subscribe to local changes for pushing to server
|
|
@@ -238,11 +341,23 @@ export class SyncClient {
|
|
|
238
341
|
await this.pushLocalChanges();
|
|
239
342
|
}
|
|
240
343
|
}
|
|
241
|
-
|
|
344
|
+
/**
|
|
345
|
+
* Apply received changesets to the local store, optionally advancing the
|
|
346
|
+
* received watermark (`lastSyncHLC`).
|
|
347
|
+
*
|
|
348
|
+
* @param advanceWatermark Only the ordered `changes` reply is contiguous and
|
|
349
|
+
* gap-free, so only it may advance the watermark. A `push_changes`
|
|
350
|
+
* broadcast is applied (idempotently) but must leave the watermark unmoved,
|
|
351
|
+
* so a broadcast the client never received is still redelivered by the next
|
|
352
|
+
* `get_changes sinceHLC=<watermark>`.
|
|
353
|
+
*/
|
|
354
|
+
async handleChanges(serializedChangeSets, advanceWatermark) {
|
|
242
355
|
const changeSets = serializedChangeSets.map(cs => deserializeChangeSet(cs));
|
|
243
356
|
const result = await this.syncManager.applyChanges(changeSets);
|
|
244
|
-
//
|
|
245
|
-
|
|
357
|
+
// Advance peer sync state with the max HLC from received changes — but only
|
|
358
|
+
// on the ordered path, where contiguity guarantees nothing below maxHlc was
|
|
359
|
+
// missed.
|
|
360
|
+
if (advanceWatermark && changeSets.length > 0 && this.serverSiteId) {
|
|
246
361
|
const maxHlc = maxHLC(changeSets.map(cs => cs.hlc));
|
|
247
362
|
if (maxHlc) {
|
|
248
363
|
await this.syncManager.updatePeerSyncState(this.serverSiteId, maxHlc);
|
|
@@ -257,12 +372,8 @@ export class SyncClient {
|
|
|
257
372
|
this.options.onRemoteChanges?.(result, changeSets);
|
|
258
373
|
this.setStatus({ status: 'synced', lastSyncTime: Date.now() });
|
|
259
374
|
}
|
|
260
|
-
handleApplyResult(message) {
|
|
261
|
-
|
|
262
|
-
if (this.pendingSentHLC) {
|
|
263
|
-
this.lastSentHLC = this.pendingSentHLC;
|
|
264
|
-
this.pendingSentHLC = null;
|
|
265
|
-
}
|
|
375
|
+
async handleApplyResult(message) {
|
|
376
|
+
await this.promoteWatermark(message.requestId);
|
|
266
377
|
this.emitSyncEvent('info', `Server applied ${message.applied ?? 0} change(s)`);
|
|
267
378
|
if (message.rejected?.length) {
|
|
268
379
|
for (const r of message.rejected) {
|
|
@@ -270,6 +381,47 @@ export class SyncClient {
|
|
|
270
381
|
}
|
|
271
382
|
}
|
|
272
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* Advance `lastSentHLC` for the acknowledged push identified by `requestId`.
|
|
386
|
+
*
|
|
387
|
+
* Only the push whose id we recorded in {@link pushLocalChanges} promotes the
|
|
388
|
+
* watermark, and only ever forward — never regressing past a newer batch a
|
|
389
|
+
* later ack already promoted. Acks we can't correlate are dropped:
|
|
390
|
+
* - a `requestId` we don't hold → a stale or duplicate ack (e.g. redelivered
|
|
391
|
+
* across a reconnect, or the server double-acked); logged, then ignored.
|
|
392
|
+
* - no `requestId` → an untracked push (a peer-relay `apply_changes`) or a
|
|
393
|
+
* legacy coordinator that doesn't echo the id; nothing to promote.
|
|
394
|
+
*/
|
|
395
|
+
async promoteWatermark(requestId) {
|
|
396
|
+
if (requestId === undefined)
|
|
397
|
+
return;
|
|
398
|
+
const promoted = this.pendingSentHLCs.get(requestId);
|
|
399
|
+
if (!promoted) {
|
|
400
|
+
this.emitSyncEvent('info', `Ignoring apply_result for unknown push (requestId: ${requestId})`);
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
this.pendingSentHLCs.delete(requestId);
|
|
404
|
+
// Never move the watermark backward: an out-of-order ack for an older batch
|
|
405
|
+
// must not undo a newer batch a prior ack already promoted.
|
|
406
|
+
if (!this.lastSentHLC || compareHLC(promoted, this.lastSentHLC) > 0) {
|
|
407
|
+
this.lastSentHLC = promoted;
|
|
408
|
+
// Persist the confirmed watermark per peer so a restart resumes delta-push
|
|
409
|
+
// from here instead of replaying local history. Only written on a real
|
|
410
|
+
// forward advance, and only for a correlated ack (so we persist a
|
|
411
|
+
// watermark we actually confirmed sent).
|
|
412
|
+
if (this.serverSiteId) {
|
|
413
|
+
await this.syncManager.updatePeerSentState(this.serverSiteId, this.lastSentHLC);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
// Drop any still-pending batches the new watermark now subsumes (a later
|
|
417
|
+
// push re-sends everything since the last ack, so its range covers theirs),
|
|
418
|
+
// so their late/duplicate acks can't re-promote an already-covered HLC.
|
|
419
|
+
for (const [id, hlc] of this.pendingSentHLCs) {
|
|
420
|
+
if (compareHLC(hlc, this.lastSentHLC) <= 0) {
|
|
421
|
+
this.pendingSentHLCs.delete(id);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
273
425
|
async handleRequestChanges(message) {
|
|
274
426
|
// Server is relaying a request for changes from another peer
|
|
275
427
|
if (!message.siteId)
|
|
@@ -295,6 +447,9 @@ export class SyncClient {
|
|
|
295
447
|
databaseId,
|
|
296
448
|
siteId: siteIdToBase64(siteId),
|
|
297
449
|
token,
|
|
450
|
+
// Stamp the wire version so the coordinator can reject a drifted client
|
|
451
|
+
// before authenticating. See handleHandshakeAck for the reverse check.
|
|
452
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
298
453
|
});
|
|
299
454
|
}
|
|
300
455
|
async requestChangesFromServer() {
|
|
@@ -308,11 +463,57 @@ export class SyncClient {
|
|
|
308
463
|
this.send({ type: 'get_changes' });
|
|
309
464
|
}
|
|
310
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* Seed `lastSentHLC` from the durable per-peer sent watermark. Called on every
|
|
468
|
+
* handshake so a fresh process resumes delta-push from the last confirmed HLC
|
|
469
|
+
* rather than re-sending its whole local history.
|
|
470
|
+
*
|
|
471
|
+
* Takes the persisted value only when it is ahead of the in-memory one, so an
|
|
472
|
+
* auto-reconnect that still holds an advanced in-memory watermark (its
|
|
473
|
+
* in-flight pushes may have promoted memory past the last durable write) is
|
|
474
|
+
* never dragged backward.
|
|
475
|
+
*/
|
|
476
|
+
async seedSentWatermark() {
|
|
477
|
+
if (!this.serverSiteId)
|
|
478
|
+
return;
|
|
479
|
+
const persisted = await this.syncManager.getPeerSentState(this.serverSiteId);
|
|
480
|
+
if (persisted && (!this.lastSentHLC || compareHLC(persisted, this.lastSentHLC) > 0)) {
|
|
481
|
+
this.lastSentHLC = persisted;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Send a message to the server.
|
|
486
|
+
*
|
|
487
|
+
* @returns true if the bytes were handed to the socket, false if the send was
|
|
488
|
+
* dropped (socket not open) or threw. Callers that advance state on a
|
|
489
|
+
* send (e.g. the delta-sync watermark) must check this — a dropped
|
|
490
|
+
* send is not success.
|
|
491
|
+
*/
|
|
311
492
|
send(message) {
|
|
312
|
-
if (this.ws?.readyState
|
|
493
|
+
if (this.ws?.readyState !== WebSocket.OPEN) {
|
|
494
|
+
// NOTE: warns on every send attempted while the socket is down; if reconnect
|
|
495
|
+
// windows ever get chatty, downgrade this to debug or rate-limit per type.
|
|
496
|
+
console.warn(`Sync send skipped, socket not open: ${message.type}`);
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
try {
|
|
313
500
|
this.ws.send(JSON.stringify(message));
|
|
501
|
+
return true;
|
|
502
|
+
}
|
|
503
|
+
catch (err) {
|
|
504
|
+
const msg = err instanceof Error ? err.message : 'unknown error';
|
|
505
|
+
console.error(`Sync send failed for ${message.type}:`, err);
|
|
506
|
+
this.emitSyncEvent('error', `Failed to send ${message.type}: ${msg}`);
|
|
507
|
+
return false;
|
|
314
508
|
}
|
|
315
509
|
}
|
|
510
|
+
/** Detach a socket's event handlers so it can no longer drive this client. */
|
|
511
|
+
detachSocketHandlers(ws) {
|
|
512
|
+
ws.onopen = null;
|
|
513
|
+
ws.onclose = null;
|
|
514
|
+
ws.onerror = null;
|
|
515
|
+
ws.onmessage = null;
|
|
516
|
+
}
|
|
316
517
|
// ==========================================================================
|
|
317
518
|
// Private: Local Change Handling
|
|
318
519
|
// ==========================================================================
|
|
@@ -345,24 +546,41 @@ export class SyncClient {
|
|
|
345
546
|
const changes = await this.syncManager.getChangesSince(this.serverSiteId, this.lastSentHLC ?? undefined);
|
|
346
547
|
if (changes.length === 0)
|
|
347
548
|
return;
|
|
348
|
-
// Track the max HLC we're sending for delta sync
|
|
349
|
-
this.pendingSentHLC = maxHLC(changes.map(cs => cs.hlc)) ?? null;
|
|
350
549
|
// Serialize and send
|
|
351
550
|
const serialized = changes.map(cs => serializeChangeSet(cs));
|
|
352
551
|
this.emitSyncEvent('local-change', `Sending ${changes.length} change set(s) to server`, {
|
|
353
552
|
changeCount: changes.length,
|
|
354
553
|
});
|
|
355
|
-
this
|
|
554
|
+
// Correlate this push with its ack: the server echoes requestId back on the
|
|
555
|
+
// apply_result, so we promote lastSentHLC only when the matching ack returns.
|
|
556
|
+
const requestId = this.nextApplyRequestId();
|
|
557
|
+
const sent = this.send({
|
|
356
558
|
type: 'apply_changes',
|
|
559
|
+
requestId,
|
|
357
560
|
changes: serialized,
|
|
358
561
|
});
|
|
562
|
+
// Only advance delta-sync state if the bytes actually left. A dropped send
|
|
563
|
+
// must be retried on the next push, so register no pending watermark and
|
|
564
|
+
// leave the pending count untouched.
|
|
565
|
+
if (!sent)
|
|
566
|
+
return;
|
|
567
|
+
// Record the max HLC this batch carries against its request id; the matching
|
|
568
|
+
// apply_result promotes lastSentHLC to it (see promoteWatermark).
|
|
569
|
+
const batchHLC = maxHLC(changes.map(cs => cs.hlc));
|
|
570
|
+
if (batchHLC) {
|
|
571
|
+
this.pendingSentHLCs.set(requestId, batchHLC);
|
|
572
|
+
}
|
|
359
573
|
this.pendingLocalChangeCount = 0;
|
|
360
574
|
}
|
|
575
|
+
/** Next monotonic apply-request id. Deterministic for test predictability. */
|
|
576
|
+
nextApplyRequestId() {
|
|
577
|
+
return `apply-${++this.applyRequestSeq}`;
|
|
578
|
+
}
|
|
361
579
|
// ==========================================================================
|
|
362
580
|
// Private: Reconnection
|
|
363
581
|
// ==========================================================================
|
|
364
582
|
scheduleReconnect() {
|
|
365
|
-
if (this.intentionalDisconnect || !this.connectionUrl || !this.options.autoReconnect) {
|
|
583
|
+
if (this.intentionalDisconnect || this.stopReconnect || !this.connectionUrl || !this.options.autoReconnect) {
|
|
366
584
|
return;
|
|
367
585
|
}
|
|
368
586
|
// Exponential backoff: 1s, 2s, 4s, 8s, ... up to max
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-client.js","sourceRoot":"","sources":["../../src/sync-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,MAAM,GAKP,MAAM,eAAe,CAAC;AAWvB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAE5B,+BAA+B;AAC/B,MAAM,0BAA0B,GAAG,IAAI,CAAC;AACxC,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAC9C,MAAM,gCAAgC,GAAG,EAAE,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IACJ,WAAW,CAAc;IACzB,UAAU,CAAmB;IAC7B,OAAO,CAED;IAEvB,kBAAkB;IACV,EAAE,GAAqB,IAAI,CAAC;IAC5B,YAAY,GAAkB,IAAI,CAAC;IAE3C,mBAAmB;IACX,OAAO,GAAe,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IACjD,aAAa,GAAkB,IAAI,CAAC;IACpC,oBAAoB,GAAkB,IAAI,CAAC;IA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E;IAErE,SAAS,CAAC,MAAkB;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAEO,aAAa,CACnB,IAAuB,EACvB,OAAe,EACf,OAA8B;QAE9B,MAAM,KAAK,GAAc;YACvB,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,OAAO;YACP,OAAO;SACR,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC"}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -103,102 +103,4 @@ export interface SyncClientOptions {
|
|
|
103
103
|
*/
|
|
104
104
|
readOnly?: boolean;
|
|
105
105
|
}
|
|
106
|
-
/** Client → Server: Handshake */
|
|
107
|
-
export interface HandshakeMessage {
|
|
108
|
-
type: 'handshake';
|
|
109
|
-
databaseId: string;
|
|
110
|
-
siteId: string;
|
|
111
|
-
token?: string;
|
|
112
|
-
}
|
|
113
|
-
/** Client → Server: Request changes */
|
|
114
|
-
export interface GetChangesMessage {
|
|
115
|
-
type: 'get_changes';
|
|
116
|
-
sinceHLC?: string;
|
|
117
|
-
}
|
|
118
|
-
/** Client → Server: Apply local changes */
|
|
119
|
-
export interface ApplyChangesMessage {
|
|
120
|
-
type: 'apply_changes';
|
|
121
|
-
changes: SerializedChangeSet[];
|
|
122
|
-
}
|
|
123
|
-
/** Client → Server: Request snapshot */
|
|
124
|
-
export interface GetSnapshotMessage {
|
|
125
|
-
type: 'get_snapshot';
|
|
126
|
-
}
|
|
127
|
-
/** Client → Server: Heartbeat */
|
|
128
|
-
export interface PingMessage {
|
|
129
|
-
type: 'ping';
|
|
130
|
-
}
|
|
131
|
-
export type ClientMessage = HandshakeMessage | GetChangesMessage | ApplyChangesMessage | GetSnapshotMessage | PingMessage;
|
|
132
|
-
/** Server → Client: Handshake acknowledgment */
|
|
133
|
-
export interface HandshakeAckMessage {
|
|
134
|
-
type: 'handshake_ack';
|
|
135
|
-
serverSiteId: string;
|
|
136
|
-
connectionId?: string;
|
|
137
|
-
}
|
|
138
|
-
/** Server → Client: Changes response */
|
|
139
|
-
export interface ChangesMessage {
|
|
140
|
-
type: 'changes';
|
|
141
|
-
changeSets: SerializedChangeSet[];
|
|
142
|
-
}
|
|
143
|
-
/** Server → Client: Pushed changes from another peer */
|
|
144
|
-
export interface PushChangesMessage {
|
|
145
|
-
type: 'push_changes';
|
|
146
|
-
changeSets: SerializedChangeSet[];
|
|
147
|
-
}
|
|
148
|
-
/** Server → Client: Apply result */
|
|
149
|
-
export interface ApplyResultMessage {
|
|
150
|
-
type: 'apply_result';
|
|
151
|
-
applied: number;
|
|
152
|
-
skipped: number;
|
|
153
|
-
conflicts: number;
|
|
154
|
-
transactions: number;
|
|
155
|
-
rejected?: Array<{
|
|
156
|
-
reason: string;
|
|
157
|
-
code?: string;
|
|
158
|
-
table?: string;
|
|
159
|
-
column?: string;
|
|
160
|
-
}>;
|
|
161
|
-
}
|
|
162
|
-
/** Server → Client: Error */
|
|
163
|
-
export interface ErrorMessage {
|
|
164
|
-
type: 'error';
|
|
165
|
-
code: string;
|
|
166
|
-
message: string;
|
|
167
|
-
}
|
|
168
|
-
/** Server → Client: Heartbeat response */
|
|
169
|
-
export interface PongMessage {
|
|
170
|
-
type: 'pong';
|
|
171
|
-
}
|
|
172
|
-
export type ServerMessage = HandshakeAckMessage | ChangesMessage | PushChangesMessage | ApplyResultMessage | ErrorMessage | PongMessage;
|
|
173
|
-
/**
|
|
174
|
-
* A ChangeSet serialized for JSON transport.
|
|
175
|
-
* SiteIds are base64url-encoded, HLCs are base64-encoded.
|
|
176
|
-
*/
|
|
177
|
-
export interface SerializedChangeSet {
|
|
178
|
-
siteId: string;
|
|
179
|
-
transactionId: string;
|
|
180
|
-
hlc: string;
|
|
181
|
-
changes: SerializedChange[];
|
|
182
|
-
schemaMigrations: SerializedSchemaMigration[];
|
|
183
|
-
}
|
|
184
|
-
export interface SerializedChange {
|
|
185
|
-
type: 'column' | 'delete';
|
|
186
|
-
schema: string;
|
|
187
|
-
table: string;
|
|
188
|
-
pk: unknown[];
|
|
189
|
-
column?: string;
|
|
190
|
-
value?: unknown;
|
|
191
|
-
hlc: string;
|
|
192
|
-
priorValue?: unknown;
|
|
193
|
-
priorHlc?: string;
|
|
194
|
-
priorRow?: unknown[];
|
|
195
|
-
}
|
|
196
|
-
export interface SerializedSchemaMigration {
|
|
197
|
-
type: string;
|
|
198
|
-
schema: string;
|
|
199
|
-
table: string;
|
|
200
|
-
ddl: string;
|
|
201
|
-
hlc: string;
|
|
202
|
-
schemaVersion: number;
|
|
203
|
-
}
|
|
204
106
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAM3F;;GAEG;AACH,MAAM,MAAM,UAAU,GAClB;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,GAC1B;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,cAAc,GAAG,UAAU,GAAG,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AAE3H;;GAEG;AACH,MAAM,WAAW,SAAS;IAC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E7B;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IAE9C;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;IAEzE;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAEzC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAEhE;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/dist/src/types.js
CHANGED
|
@@ -2,4 +2,9 @@
|
|
|
2
2
|
* Types for the WebSocket sync client.
|
|
3
3
|
*/
|
|
4
4
|
export {};
|
|
5
|
+
// The WebSocket message unions (ClientMessage / ServerMessage and their
|
|
6
|
+
// per-message interfaces) and the Serialized* JSON-transport types formerly
|
|
7
|
+
// declared here now live in @quereus/sync (`sync/wire.ts`) — the single wire
|
|
8
|
+
// definition shared with the coordinator. Import them from '@quereus/sync';
|
|
9
|
+
// index.ts re-exports them so the client's public API is unchanged.
|
|
5
10
|
//# sourceMappingURL=types.js.map
|
package/dist/src/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAqHH,wEAAwE;AACxE,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,oEAAoE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quereus/sync-client",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "WebSocket sync client for Quereus - handles connection, reconnection, and change synchronization",
|
|
6
6
|
"keywords": [
|
|
@@ -36,12 +36,13 @@
|
|
|
36
36
|
"scripts": {
|
|
37
37
|
"clean": "rimraf dist",
|
|
38
38
|
"build": "tsc",
|
|
39
|
+
"lint": "echo 'No lint configured'",
|
|
39
40
|
"typecheck": "tsc --noEmit",
|
|
40
41
|
"test": "cd ../.. && node --import ./packages/quereus-sync-client/register.mjs node_modules/mocha/bin/mocha.js \"packages/quereus-sync-client/test/**/*.spec.ts\" --reporter min --colors",
|
|
41
42
|
"test:single": "cd ../.. && node --import ./packages/quereus-sync-client/register.mjs node_modules/mocha/bin/mocha.js --bail"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
|
-
"@quereus/sync": "^4.
|
|
45
|
+
"@quereus/sync": "^4.4.0"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@types/mocha": "^10.0.10",
|
|
@@ -53,8 +54,8 @@
|
|
|
53
54
|
"typescript": "^5.9.3"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@quereus/quereus": "^4.
|
|
57
|
-
"@quereus/sync": "^4.
|
|
57
|
+
"@quereus/quereus": "^4.4.0",
|
|
58
|
+
"@quereus/sync": "^4.4.0"
|
|
58
59
|
},
|
|
59
60
|
"quereus": {
|
|
60
61
|
"provides": {
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Serialization helpers for ChangeSet transport over JSON.
|
|
3
|
-
*
|
|
4
|
-
* - SiteIds use base64url encoding (via siteIdToBase64/siteIdFromBase64)
|
|
5
|
-
* - HLCs use standard base64 encoding (via btoa/atob in browser, Buffer in Node)
|
|
6
|
-
* - Uint8Array values use `{ __bin: "<base64>" }` tagged encoding
|
|
7
|
-
*/
|
|
8
|
-
import { type ChangeSet, type HLC } from '@quereus/sync';
|
|
9
|
-
import type { SerializedChangeSet } from './types.js';
|
|
10
|
-
/**
|
|
11
|
-
* Serialize a ChangeSet for JSON transport.
|
|
12
|
-
* Encodes Uint8Array values in changes and PKs so they survive JSON round-trip.
|
|
13
|
-
*
|
|
14
|
-
* @param cs - The ChangeSet to serialize
|
|
15
|
-
* @returns A JSON-serializable object
|
|
16
|
-
*/
|
|
17
|
-
export declare function serializeChangeSet(cs: ChangeSet): SerializedChangeSet;
|
|
18
|
-
/**
|
|
19
|
-
* Deserialize a ChangeSet from JSON transport format.
|
|
20
|
-
* Decodes tagged Uint8Array values in changes and PKs.
|
|
21
|
-
*
|
|
22
|
-
* @param obj - The serialized ChangeSet object
|
|
23
|
-
* @returns The deserialized ChangeSet
|
|
24
|
-
*/
|
|
25
|
-
export declare function deserializeChangeSet(obj: SerializedChangeSet): ChangeSet;
|
|
26
|
-
/**
|
|
27
|
-
* Serialize an HLC for transport (base64 encoding).
|
|
28
|
-
*
|
|
29
|
-
* @param hlc - The HLC to serialize
|
|
30
|
-
* @returns Base64-encoded string
|
|
31
|
-
*/
|
|
32
|
-
export declare function serializeHLCForTransport(hlc: HLC): string;
|
|
33
|
-
/**
|
|
34
|
-
* Deserialize an HLC from transport format.
|
|
35
|
-
*
|
|
36
|
-
* @param str - Base64-encoded HLC string
|
|
37
|
-
* @returns The deserialized HLC
|
|
38
|
-
*/
|
|
39
|
-
export declare function deserializeHLCFromTransport(str: string): HLC;
|
|
40
|
-
//# sourceMappingURL=serialization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../src/serialization.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAOL,KAAK,SAAS,EAKd,KAAK,GAAG,EACT,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAkCtD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,SAAS,GAAG,mBAAmB,CA8CrE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,mBAAmB,GAAG,SAAS,CAwCxE;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAE5D"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Serialization helpers for ChangeSet transport over JSON.
|
|
3
|
-
*
|
|
4
|
-
* - SiteIds use base64url encoding (via siteIdToBase64/siteIdFromBase64)
|
|
5
|
-
* - HLCs use standard base64 encoding (via btoa/atob in browser, Buffer in Node)
|
|
6
|
-
* - Uint8Array values use `{ __bin: "<base64>" }` tagged encoding
|
|
7
|
-
*/
|
|
8
|
-
import { serializeHLC, deserializeHLC, siteIdToBase64, siteIdFromBase64, encodeSqlValue, decodeSqlValue, } from '@quereus/sync';
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// Base64 helpers (work in both browser and Node.js)
|
|
11
|
-
// ============================================================================
|
|
12
|
-
/**
|
|
13
|
-
* Encode bytes to base64 string.
|
|
14
|
-
*/
|
|
15
|
-
function bytesToBase64(bytes) {
|
|
16
|
-
// Browser: use btoa
|
|
17
|
-
if (typeof btoa === 'function') {
|
|
18
|
-
return btoa(String.fromCharCode(...bytes));
|
|
19
|
-
}
|
|
20
|
-
// Node.js: use Buffer
|
|
21
|
-
return Buffer.from(bytes).toString('base64');
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Decode base64 string to bytes.
|
|
25
|
-
*/
|
|
26
|
-
function base64ToBytes(str) {
|
|
27
|
-
// Browser: use atob
|
|
28
|
-
if (typeof atob === 'function') {
|
|
29
|
-
return Uint8Array.from(atob(str), c => c.charCodeAt(0));
|
|
30
|
-
}
|
|
31
|
-
// Node.js: use Buffer
|
|
32
|
-
return new Uint8Array(Buffer.from(str, 'base64'));
|
|
33
|
-
}
|
|
34
|
-
// ============================================================================
|
|
35
|
-
// ChangeSet Serialization
|
|
36
|
-
// ============================================================================
|
|
37
|
-
/**
|
|
38
|
-
* Serialize a ChangeSet for JSON transport.
|
|
39
|
-
* Encodes Uint8Array values in changes and PKs so they survive JSON round-trip.
|
|
40
|
-
*
|
|
41
|
-
* @param cs - The ChangeSet to serialize
|
|
42
|
-
* @returns A JSON-serializable object
|
|
43
|
-
*/
|
|
44
|
-
export function serializeChangeSet(cs) {
|
|
45
|
-
return {
|
|
46
|
-
siteId: siteIdToBase64(cs.siteId),
|
|
47
|
-
transactionId: cs.transactionId,
|
|
48
|
-
hlc: bytesToBase64(serializeHLC(cs.hlc)),
|
|
49
|
-
changes: cs.changes.map(c => {
|
|
50
|
-
const base = {
|
|
51
|
-
type: c.type,
|
|
52
|
-
schema: c.schema,
|
|
53
|
-
table: c.table,
|
|
54
|
-
pk: c.pk.map(v => encodeSqlValue(v)),
|
|
55
|
-
hlc: bytesToBase64(serializeHLC(c.hlc)),
|
|
56
|
-
};
|
|
57
|
-
if (c.type === 'column') {
|
|
58
|
-
const cc = c;
|
|
59
|
-
return {
|
|
60
|
-
...base,
|
|
61
|
-
column: cc.column,
|
|
62
|
-
value: encodeSqlValue(cc.value),
|
|
63
|
-
// Carry the per-cell before-image (value + HLC) present-only: write both
|
|
64
|
-
// together gated on priorHlc, never a phantom key. priorHlc reuses the same
|
|
65
|
-
// base64-binary HLC encoding as `hlc`; priorValue rides encodeSqlValue.
|
|
66
|
-
...(cc.priorHlc !== undefined
|
|
67
|
-
? {
|
|
68
|
-
priorValue: encodeSqlValue(cc.priorValue ?? null),
|
|
69
|
-
priorHlc: bytesToBase64(serializeHLC(cc.priorHlc)),
|
|
70
|
-
}
|
|
71
|
-
: {}),
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
const rd = c;
|
|
75
|
-
return {
|
|
76
|
-
...base,
|
|
77
|
-
// Carry the row before-image present-only. An empty array is present:
|
|
78
|
-
// [].map(...) is still [] and [] !== undefined, so the conditional spread
|
|
79
|
-
// preserves the empty-present vs absent boundary.
|
|
80
|
-
...(rd.priorRow !== undefined
|
|
81
|
-
? { priorRow: rd.priorRow.map(v => encodeSqlValue(v)) }
|
|
82
|
-
: {}),
|
|
83
|
-
};
|
|
84
|
-
}),
|
|
85
|
-
schemaMigrations: cs.schemaMigrations.map(m => ({
|
|
86
|
-
...m,
|
|
87
|
-
hlc: bytesToBase64(serializeHLC(m.hlc)),
|
|
88
|
-
})),
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Deserialize a ChangeSet from JSON transport format.
|
|
93
|
-
* Decodes tagged Uint8Array values in changes and PKs.
|
|
94
|
-
*
|
|
95
|
-
* @param obj - The serialized ChangeSet object
|
|
96
|
-
* @returns The deserialized ChangeSet
|
|
97
|
-
*/
|
|
98
|
-
export function deserializeChangeSet(obj) {
|
|
99
|
-
return {
|
|
100
|
-
siteId: siteIdFromBase64(obj.siteId),
|
|
101
|
-
transactionId: obj.transactionId,
|
|
102
|
-
hlc: deserializeHLC(base64ToBytes(obj.hlc)),
|
|
103
|
-
changes: obj.changes.map(c => {
|
|
104
|
-
const base = {
|
|
105
|
-
type: c.type,
|
|
106
|
-
schema: c.schema,
|
|
107
|
-
table: c.table,
|
|
108
|
-
pk: c.pk.map(v => decodeSqlValue(v)),
|
|
109
|
-
hlc: deserializeHLC(base64ToBytes(c.hlc)),
|
|
110
|
-
};
|
|
111
|
-
if (c.type === 'column') {
|
|
112
|
-
return {
|
|
113
|
-
...base,
|
|
114
|
-
column: c.column,
|
|
115
|
-
value: decodeSqlValue(c.value),
|
|
116
|
-
// Mirror serialize: attach the before-image only when the serialized
|
|
117
|
-
// object carries it, so absent stays absent (not a phantom undefined).
|
|
118
|
-
...(c.priorHlc !== undefined
|
|
119
|
-
? {
|
|
120
|
-
priorValue: decodeSqlValue(c.priorValue),
|
|
121
|
-
priorHlc: deserializeHLC(base64ToBytes(c.priorHlc)),
|
|
122
|
-
}
|
|
123
|
-
: {}),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
...base,
|
|
128
|
-
...(c.priorRow !== undefined
|
|
129
|
-
? { priorRow: c.priorRow.map(v => decodeSqlValue(v)) }
|
|
130
|
-
: {}),
|
|
131
|
-
};
|
|
132
|
-
}),
|
|
133
|
-
schemaMigrations: obj.schemaMigrations.map(m => ({
|
|
134
|
-
...m,
|
|
135
|
-
hlc: deserializeHLC(base64ToBytes(m.hlc)),
|
|
136
|
-
})),
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Serialize an HLC for transport (base64 encoding).
|
|
141
|
-
*
|
|
142
|
-
* @param hlc - The HLC to serialize
|
|
143
|
-
* @returns Base64-encoded string
|
|
144
|
-
*/
|
|
145
|
-
export function serializeHLCForTransport(hlc) {
|
|
146
|
-
return bytesToBase64(serializeHLC(hlc));
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Deserialize an HLC from transport format.
|
|
150
|
-
*
|
|
151
|
-
* @param str - Base64-encoded HLC string
|
|
152
|
-
* @returns The deserialized HLC
|
|
153
|
-
*/
|
|
154
|
-
export function deserializeHLCFromTransport(str) {
|
|
155
|
-
return deserializeHLC(base64ToBytes(str));
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=serialization.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.js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