@volter/world-core 3.0.114 → 3.0.115

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.
@@ -89,7 +89,7 @@ async function decoded(m, request) {
89
89
  const raw = new Uint8Array(await request.arrayBuffer());
90
90
  const coding = (codings[0] ?? '');
91
91
  if (!m.encodings?.request?.includes(coding))
92
- return new Request(request.url, { method: request.method, headers: request.headers, body: raw });
92
+ return new Request(request.url, { method: request.method, headers: request.headers, body: raw, signal: request.signal });
93
93
  let body;
94
94
  try {
95
95
  body = await decompress(raw, coding, decodedBodyLimit(m.descriptor?.maxRequestBodySize));
@@ -102,7 +102,7 @@ async function decoded(m, request) {
102
102
  headers.delete('content-length');
103
103
  // A finite single-chunk stream holds the decoder's buffer; BufferSource extraction would copy the entire body.
104
104
  const buffered = new ReadableStream({ start(controller) { controller.enqueue(body); controller.close(); } });
105
- return new Request(request.url, { method: request.method, headers, body: buffered, duplex: 'half' });
105
+ return new Request(request.url, { method: request.method, headers, body: buffered, signal: request.signal, duplex: 'half' });
106
106
  }
107
107
  /** An answer in the coding the request accepts, when the manifest's `encodings` answers in it. */
108
108
  async function encoded(m, request, res) {
@@ -310,7 +310,7 @@ export function createPackFetch(parts, options = {}) {
310
310
  if (Object.keys(groups).length)
311
311
  headers.set(PREFIX_PARAMS_HEADER, JSON.stringify(groups));
312
312
  url.pathname = path;
313
- return new Request(url, { method: request.method, headers, body: request.body, ...(request.body ? { duplex: 'half' } : {}) });
313
+ return new Request(url, { method: request.method, headers, body: request.body, signal: request.signal, ...(request.body ? { duplex: 'half' } : {}) });
314
314
  };
315
315
  const rootServes = (method, path) => Boolean(matchOperation(routes, method, path));
316
316
  const lane = m.lanes ? laneRouter(m.vendor, m.lanes, parts.lanes ?? {}, rootServes) : undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/world-core",
3
- "version": "3.0.114",
3
+ "version": "3.0.115",
4
4
  "description": "The kernel of Volter World: one log per twin, branches as pointers, checkpoints, the fold that keeps a twin current, the head that performs a write against the vendor, references, and the git plane. A twin package builds on it; the runtime serves it.",
5
5
  "keywords": [
6
6
  "twin",
package/src/pack-fetch.ts CHANGED
@@ -158,7 +158,7 @@ async function decoded(m: DerivedManifest, request: Request): Promise<Request |
158
158
  // whose second branch a Bun server never finishes, and the request hung
159
159
  const raw = new Uint8Array(await request.arrayBuffer());
160
160
  const coding = (codings[0] ?? '') as ContentCoding;
161
- if (!m.encodings?.request?.includes(coding)) return new Request(request.url, { method: request.method, headers: request.headers, body: raw });
161
+ if (!m.encodings?.request?.includes(coding)) return new Request(request.url, { method: request.method, headers: request.headers, body: raw, signal: request.signal });
162
162
  let body: Uint8Array;
163
163
  try { body = await decompress(raw, coding, decodedBodyLimit(m.descriptor?.maxRequestBodySize)); }
164
164
  catch (error) { return error instanceof RequestBodyTooLargeError ? oversizedBody() : undefined; }
@@ -167,7 +167,7 @@ async function decoded(m: DerivedManifest, request: Request): Promise<Request |
167
167
  headers.delete('content-length');
168
168
  // A finite single-chunk stream holds the decoder's buffer; BufferSource extraction would copy the entire body.
169
169
  const buffered = new ReadableStream<Uint8Array>({ start(controller) { controller.enqueue(body); controller.close(); } });
170
- return new Request(request.url, { method: request.method, headers, body: buffered, duplex: 'half' } as RequestInit);
170
+ return new Request(request.url, { method: request.method, headers, body: buffered, signal: request.signal, duplex: 'half' } as RequestInit);
171
171
  }
172
172
 
173
173
  /** An answer in the coding the request accepts, when the manifest's `encodings` answers in it. */
@@ -354,7 +354,7 @@ export function createPackFetch(parts: PackParts, options: PackFetchOptions = {}
354
354
  if (!headers.has(ORIGINAL_PATH_HEADER)) headers.set(ORIGINAL_PATH_HEADER, url.pathname);
355
355
  if (Object.keys(groups).length) headers.set(PREFIX_PARAMS_HEADER, JSON.stringify(groups));
356
356
  url.pathname = path;
357
- return new Request(url, { method: request.method, headers, body: request.body, ...(request.body ? { duplex: 'half' } : {}) } as RequestInit);
357
+ return new Request(url, { method: request.method, headers, body: request.body, signal: request.signal, ...(request.body ? { duplex: 'half' } : {}) } as RequestInit);
358
358
  };
359
359
  const rootServes = (method: string, path: string): boolean => Boolean(matchOperation(routes, method, path));
360
360
  const lane = m.lanes ? laneRouter(m.vendor, m.lanes, parts.lanes ?? {}, rootServes) : undefined;