@pgxsinkit/server 0.5.2 → 0.6.0-rc.2

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.
@@ -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,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC,SAAS,cAAc,EAAE,CAAC,EAAE,CAAC;CACtF;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,4BAA6B,SAAQ,KAAK;IACrD,cAMC;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,kFAAkF;IAClF,GAAG,EAAE,SAAS,CAAC;IACf;;;;;;;;;;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AM,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
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;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C,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);
@@ -3290,4 +3291,4 @@ export {
3290
3291
  verifyStreamToken
3291
3292
  };
3292
3293
 
3293
- //# debugId=A99B60012F83C2B064756E2164756E21
3294
+ //# debugId=84902501E0AA912A64756E2164756E21