@pgxsinkit/server 0.5.1 → 0.6.0-rc.1

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.
@@ -72,7 +72,7 @@ export interface StreamGateOptions {
72
72
  entitlements?: EntitlementSet;
73
73
  /**
74
74
  * Base URL of the durable-streams server, with whatever stream prefix it is mounted under — the
75
- * same value the engine is given as `ELECTRIC_CIRCUITS_DS_URL`, since both address the same paths.
75
+ * same value the engine is given as `CIRCUITS_DS_URL`, since both address the same paths.
76
76
  */
77
77
  durableStreamsUrl: string;
78
78
  /**
@@ -139,21 +139,22 @@ export declare function readStreamToken(request: Request): string | null;
139
139
  * durable-streams protocol answers with is outside it, so a CROSS-ORIGIN reader sees NONE of them
140
140
  * unless the mount names them on `Access-Control-Expose-Headers`.
141
141
  *
142
- * The failure that follows is silent and expensive rather than loud. `@durable-streams/client` drives
143
- * its entire read loop off these headers — verified by grepping the installed 0.2.6 dist
144
- * (`@durable-streams/client/dist/index.js`, mirrored in its shipped `src/`): `Stream-Next-Offset`,
145
- * `Stream-Cursor` and `Stream-Closed` are read per response, `Stream-Up-To-Date` is a presence check
146
- * (`headers.has`, which is why it is easy to miss), `stream-sse-data-encoding` decides SSE payload
147
- * decoding, and `etag` is read on the stream-metadata path. Stripped of them, the client never learns
148
- * an offset: it re-requests `offset=-1` forever and never switches to a live long poll, which presents
149
- * as a hot loop of hundreds of requests per second per shape with no error raised anywhere.
142
+ * Two generations of client read these. `@pgxsinkit/client`'s own reader (`READ_RESPONSE_HEADERS` in
143
+ * its `circuits/long-poll.ts`, which a unit test holds to this list) steers by `Stream-Next-Offset`,
144
+ * `Stream-Up-To-Date` (a presence check, which is why it is easy to miss), `Stream-Cursor` and
145
+ * `Stream-Closed`. Stripped of them it cannot make progress and fails the read, loudly. Clients still
146
+ * in the field on `@durable-streams/client` (0.2.x, which pgxsinkit read through until ADR-0065
147
+ * decision 6) drive their whole read loop off the same four and also read `stream-sse-data-encoding`
148
+ * (SSE payload decoding) and `etag` (the stream-metadata path). Stripped of them, that client never
149
+ * learns an offset: it re-requests `offset=-1` forever and never switches to a live long poll, which
150
+ * presents as a hot loop of hundreds of requests per second per shape with no error raised anywhere.
151
+ * Both floor their retry backoff on `Retry-After`; without it they fall back on their own schedule.
150
152
  *
151
- * `Stream-Seq`, `Stream-TTL` and `Stream-Expires-At` are request headers in that client version. They
152
- * are named here anyway because this list is a statement about the ds protocol's response namespace
153
- * rather than about which subset one client version happens to read today — exposing a header a
154
- * response never carries is inert, while omitting one that it does carry wedges the reader. The
155
- * `Producer-*` headers are deliberately absent: they belong to the write path, which does not come
156
- * through this gate.
153
+ * `Stream-Seq`, `Stream-TTL` and `Stream-Expires-At` are read by neither. They are named here
154
+ * anyway because this list is a statement about the ds protocol's response namespace rather than about
155
+ * which subset one client version happens to read today — exposing a header a response never carries
156
+ * is inert, while omitting one that it does carry wedges the reader. The `Producer-*` headers are
157
+ * deliberately absent: they belong to the write path, which does not come through this gate.
157
158
  *
158
159
  * EVERY mount of `createStreamGate` must put these on `Access-Control-Expose-Headers` of the ACTUAL
159
160
  * (non-preflight) response. The gate cannot do it itself — it forwards the upstream response's
@@ -1 +1 @@
1
- {"version":3,"file":"edge.d.ts","sourceRoot":"","sources":["../../src/circuits/edge.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAqC,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGjH,OAAO,EAAgC,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEhF;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,wDAAwD;IACxD,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,cAAc,EAAE,GAAG,OAAO,CAAC;IACtF;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,OAAO,EAA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AA2D;IAC3D,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,cAAc,CAAC,GACtF,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC;AAE3D,MAAM,MAAM,YAAY,GACpB;IACE,KAAK,EAAE,IAAI,CAAC;IACZ,KAAK,EAAE,WAAW,CAAC;IACnB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,GACD;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAErC;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,YAAY,CAAC,CAqBvB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAK/D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAWxD,CAAC;AAgDF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,aAIT,OAAO,QAAQ,MAAM,OAAO,MAAM,KAAG,OAAO,CAAC,QAAQ,CAAC,CAmHvG"}
@@ -86,7 +86,7 @@ export declare function createCircuitsEngineClient(options: CircuitsEngineOption
86
86
  * `flipFailures > 0` means a batch was **abandoned** after exhausting its propagation retries:
87
87
  * those membership effects are gone rather than late. The engine keeps the abandoned batch's
88
88
  * `pendingFlips` count held — so the waiting terms never falsely read converged — and latches
89
- * itself degraded: `/v1/health` answers 503, so do its membership-bearing routes, and a reaper
89
+ * itself degraded: `/ready` answers 503, so do its membership-bearing routes, and a reaper
90
90
  * deletes every subquery shape stream. Recovery is an operator restart.
91
91
  *
92
92
  * The answer is VALIDATED, not cast. An engine that does not report both counters cannot answer
@@ -61,7 +61,7 @@ export interface SubscribeOptions {
61
61
  *
62
62
  * The control plane renews every live claim on exactly one cadence: the token re-mint, which the
63
63
  * client drives at `expiresAt - skew` and which therefore lands at most `ttlSeconds` apart. The
64
- * engine releases a claim not renewed within `leaseSeconds` (`ELECTRIC_CIRCUITS_SHAPE_IDLE_SECS`).
64
+ * engine releases a claim not renewed within `leaseSeconds` (`CIRCUITS_SHAPE_IDLE_SECS`).
65
65
  * So a deployment whose lease window is under two TTLs has no margin at all: one refresh delayed by a
66
66
  * retry, a redeploy, or a sleeping tab, and a live session's shape goes dormant underneath it. The
67
67
  * factor of two is the margin for exactly one missed refresh.
@@ -71,7 +71,7 @@ export interface SubscribeOptions {
71
71
  * you" — and never a denial: a client told it lost entitlement truncates its rows.
72
72
  */
73
73
  export declare class CircuitsLeaseConfigError extends Error {
74
- /** The engine's `ELECTRIC_CIRCUITS_SHAPE_IDLE_SECS`, as the create response reported it. */
74
+ /** The engine's `CIRCUITS_SHAPE_IDLE_SECS`, as the create response reported it. */
75
75
  readonly leaseSeconds: number;
76
76
  /** The stream-token TTL this control plane is configured with. */
77
77
  readonly ttlSeconds: number;
@@ -1 +1 @@
1
- {"version":3,"file":"subscribe.d.ts","sourceRoot":"","sources":["../../src/circuits/subscribe.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,cAAc,EAEnB,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAwE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG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C3D,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAClD,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAC9C,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAE9C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,MAAM,EAAE,oBAAoB,CAAC;IAC7B,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IACvF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,aAI8C,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAC,CAgBzE;AAED,eAAO,MAAM,WAAW,qBAAqB,CAAC"}
@@ -56,7 +56,7 @@ export interface CircuitsShapeHandle {
56
56
  subscription: string;
57
57
  /**
58
58
  * How long this subscription may go unrenewed before the engine releases it
59
- * (`ELECTRIC_CIRCUITS_SHAPE_IDLE_SECS`, default 1800). `0` means leases never lapse, because that
59
+ * (`CIRCUITS_SHAPE_IDLE_SECS`, default 1800). `0` means leases never lapse, because that
60
60
  * setting also disables dormancy.
61
61
  *
62
62
  * Reported rather than guessed: the renewal cadence is the deployment's to set, and a control plane
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AAQH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAU9D,+GAA+G;AAC/G,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE;;;;;;;;;;;;EA+EvC;AAED,0GAA0G;AAC1G,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,SAAgB,GAAG,MAAM,CAE3F;AAMD,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAwBnH;AAiCD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuBxB;AA6ED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYvF"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;GAcG;AAiBH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAU9D,+GAA+G;AAC/G,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE;;;;;;;;;;;;EA+EvC;AAED,0GAA0G;AAC1G,wBAAgB,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,SAAgB,GAAG,MAAM,CAE3F;AAMD,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAwBnH;AAkCD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuBxB;AA6ED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYvF"}
package/dist/index.js CHANGED
@@ -264,7 +264,8 @@ var STREAM_READ_EXPOSED_HEADERS = [
264
264
  "stream-ttl",
265
265
  "stream-expires-at",
266
266
  "stream-sse-data-encoding",
267
- "etag"
267
+ "etag",
268
+ "retry-after"
268
269
  ];
269
270
  function rewrittenEgressHeaders(upstream) {
270
271
  const headers = new Headers(upstream);
@@ -425,7 +426,7 @@ class CircuitsLeaseConfigError extends Error {
425
426
  leaseSeconds;
426
427
  ttlSeconds;
427
428
  constructor(leaseSeconds, ttlSeconds) {
428
- super(`[pgxsinkit] the sync engine's shape lease window (${leaseSeconds}s, ` + `ELECTRIC_CIRCUITS_SHAPE_IDLE_SECS) is shorter than twice this control plane's stream-token TTL ` + `(${ttlSeconds}s, the \`ttlSeconds\` option). Claims are renewed on the token re-mint, so a single ` + `missed refresh would let a live session's subscription lapse and its shape go dormant underneath ` + `it. Raise ELECTRIC_CIRCUITS_SHAPE_IDLE_SECS to at least ${2 * ttlSeconds}, lower \`ttlSeconds\` to ` + `at most ${Math.floor(leaseSeconds / 2)}, or set ELECTRIC_CIRCUITS_SHAPE_IDLE_SECS=0 to disable ` + `leases entirely.`);
429
+ super(`[pgxsinkit] the sync engine's shape lease window (${leaseSeconds}s, ` + `CIRCUITS_SHAPE_IDLE_SECS) is shorter than twice this control plane's stream-token TTL ` + `(${ttlSeconds}s, the \`ttlSeconds\` option). Claims are renewed on the token re-mint, so a single ` + `missed refresh would let a live session's subscription lapse and its shape go dormant underneath ` + `it. Raise CIRCUITS_SHAPE_IDLE_SECS to at least ${2 * ttlSeconds}, lower \`ttlSeconds\` to ` + `at most ${Math.floor(leaseSeconds / 2)}, or set CIRCUITS_SHAPE_IDLE_SECS=0 to disable ` + `leases entirely.`);
429
430
  this.name = "CircuitsLeaseConfigError";
430
431
  this.leaseSeconds = leaseSeconds;
431
432
  this.ttlSeconds = ttlSeconds;
@@ -3290,4 +3291,4 @@ export {
3290
3291
  verifyStreamToken
3291
3292
  };
3292
3293
 
3293
- //# debugId=51F8EC2D39BDA31B64756E2164756E21
3294
+ //# debugId=84902501E0AA912A64756E2164756E21