@syncular/server 0.97.0 → 0.98.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/events.d.ts +3 -2
- package/dist/handler.js +3 -4
- package/package.json +2 -2
- package/src/events.ts +3 -2
- package/src/handler.ts +3 -4
package/dist/events.d.ts
CHANGED
|
@@ -290,8 +290,9 @@ export interface PruneCompletedEvent {
|
|
|
290
290
|
readonly advanced: boolean;
|
|
291
291
|
readonly removedCommits: number;
|
|
292
292
|
}
|
|
293
|
-
/** The host `resolveScopes` callback threw
|
|
294
|
-
*
|
|
293
|
+
/** The host `resolveScopes` callback threw (§3.2 rule 3): a sync request
|
|
294
|
+
* fails with `sync.internal_error`, a download or realtime registration is
|
|
295
|
+
* denied. */
|
|
295
296
|
export interface ScopesResolveFailedEvent {
|
|
296
297
|
readonly type: 'scopes.resolve_failed';
|
|
297
298
|
readonly atMs: number;
|
package/dist/handler.js
CHANGED
|
@@ -76,9 +76,8 @@ async function resolveOnce(ctx, clientId, schema) {
|
|
|
76
76
|
catch (error) {
|
|
77
77
|
if (error instanceof SyncError)
|
|
78
78
|
throw error;
|
|
79
|
-
// §3.2 rule
|
|
80
|
-
//
|
|
81
|
-
// outage (§7.3.3): it never reaches the lease.
|
|
79
|
+
// §3.2 rule 3: a throw fails the whole request; nothing is revoked,
|
|
80
|
+
// rejected or leased. A throw is NOT an outage (§7.3.3).
|
|
82
81
|
const events = ctx.events;
|
|
83
82
|
if (events !== undefined) {
|
|
84
83
|
emitEvent(events, {
|
|
@@ -90,7 +89,7 @@ async function resolveOnce(ctx, clientId, schema) {
|
|
|
90
89
|
message: error instanceof Error ? error.message : String(error),
|
|
91
90
|
});
|
|
92
91
|
}
|
|
93
|
-
|
|
92
|
+
throw error;
|
|
94
93
|
}
|
|
95
94
|
if (allowed === RESOLVER_OUTAGE) {
|
|
96
95
|
// §7.3.3: the host opted this request into lease authorization. No
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncular/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.98.0",
|
|
4
4
|
"description": "Syncular server: handleSyncRequest + storage/auth interfaces for the sync protocol",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Benjamin Kniffler",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"verify:node": "cd ../.. && bun build ./packages/server/test/sqlite-runtime/verify-node.mjs --target=node --conditions=bun --outfile=./packages/server/.verify-node.built.mjs && node ./packages/server/.verify-node.built.mjs"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@syncular/core": "0.
|
|
71
|
+
"@syncular/core": "0.98.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@electric-sql/pglite": "^0.5.4"
|
package/src/events.ts
CHANGED
|
@@ -324,8 +324,9 @@ export interface PruneCompletedEvent {
|
|
|
324
324
|
readonly removedCommits: number;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
/** The host `resolveScopes` callback threw
|
|
328
|
-
*
|
|
327
|
+
/** The host `resolveScopes` callback threw (§3.2 rule 3): a sync request
|
|
328
|
+
* fails with `sync.internal_error`, a download or realtime registration is
|
|
329
|
+
* denied. */
|
|
329
330
|
export interface ScopesResolveFailedEvent {
|
|
330
331
|
readonly type: 'scopes.resolve_failed';
|
|
331
332
|
readonly atMs: number;
|
package/src/handler.ts
CHANGED
|
@@ -205,9 +205,8 @@ async function resolveOnce(
|
|
|
205
205
|
});
|
|
206
206
|
} catch (error) {
|
|
207
207
|
if (error instanceof SyncError) throw error;
|
|
208
|
-
// §3.2 rule
|
|
209
|
-
//
|
|
210
|
-
// outage (§7.3.3): it never reaches the lease.
|
|
208
|
+
// §3.2 rule 3: a throw fails the whole request; nothing is revoked,
|
|
209
|
+
// rejected or leased. A throw is NOT an outage (§7.3.3).
|
|
211
210
|
const events = ctx.events;
|
|
212
211
|
if (events !== undefined) {
|
|
213
212
|
emitEvent(events, {
|
|
@@ -219,7 +218,7 @@ async function resolveOnce(
|
|
|
219
218
|
message: error instanceof Error ? error.message : String(error),
|
|
220
219
|
});
|
|
221
220
|
}
|
|
222
|
-
|
|
221
|
+
throw error;
|
|
223
222
|
}
|
|
224
223
|
|
|
225
224
|
if (allowed === RESOLVER_OUTAGE) {
|