Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/core/execution/src/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ export const buildExecuteDescription = (executor: Executor): Effect.Effect<strin
Effect.gen(function* () {
const sources: readonly Source[] = yield* executor.sources
.list()
.pipe(Effect.orDie, Effect.withSpan("executor.sources.list"));
.pipe(
// oxlint-disable-next-line executor/no-effect-escape-hatch -- boundary: ExecutionEngine.getDescription currently exposes no error channel; engine typed-error widening is covered separately
Effect.orDie,
Effect.withSpan("executor.sources.list"),
);

const description = yield* Effect.sync(() => formatDescription(sources)).pipe(
Effect.withSpan("schema.compile.description", {
Expand Down
11 changes: 7 additions & 4 deletions packages/kernel/runtime-dynamic-worker/src/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { describe, expect, it } from "@effect/vitest";
import { env } from "cloudflare:workers";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Predicate from "effect/Predicate";
import { HttpClient, HttpClientResponse, type HttpClientRequest } from "effect/unstable/http";

import {
Expand Down Expand Up @@ -85,15 +86,17 @@ const makeRecordingHttpClient = () => {
const headers = { ...request.headers };
let bytes = new Uint8Array();
let contentType = headers["content-type"] ?? "";
const tag = request.body._tag;
const isRaw = Predicate.isTagged(request.body, "Raw");
const isUint8Array = Predicate.isTagged(request.body, "Uint8Array");
const isFormData = Predicate.isTagged(request.body, "FormData");

if (tag === "Raw" || tag === "Uint8Array") {
if (isRaw || isUint8Array) {
const wire = new Request("http://capture/", {
method: "POST",
body: request.body.body as BodyInit,
});
bytes = new Uint8Array(yield* Effect.promise(() => wire.arrayBuffer()));
} else if (tag === "FormData") {
} else if (isFormData) {
// Letting `Response` realize the FormData yields the actual
// multipart wire bytes plus a generated boundary in its
// content-type header — exactly what the upstream server sees.
Expand All @@ -106,7 +109,7 @@ const makeRecordingHttpClient = () => {
url: request.url,
method: request.method,
contentType,
bodyKind: tag,
bodyKind: isRaw ? "Raw" : isUint8Array ? "Uint8Array" : isFormData ? "FormData" : "",
body: bytes,
});

Expand Down
Loading