fix(http): Fileserver 업로드 실패에 Envelope의 traceId를 싣는다
문제: readFailureEnvelope는 실패 Envelope의 meta.traceId를 함께 돌려주고, V3 실행기는 그 값을 AppFailure.traceId로 싣는다(1103/03-06). Fileserver client는 envelope.value만 넘겨 traceId를 버린다. 지원 담당이 업로드 실패를 서버 로그의 요청과 잇지 못한다. 같은 백엔드의 다른 쓰기 실패는 이을 수 있다. 고른 방법: envelopeFailure가 읽은 Envelope 전체를 받아 traceId가 있으면 createFailure의 traceId로 싣는다. V3와 같은 규칙이다. 없으면 키를 두지 않는다. 매뉴얼 7절 결과 읽기에 한 줄 적었다. 위험·한계: Envelope 실패에만 싣는다. 성공 Envelope을 읽지 못한 실패 (SCHEMA_MISMATCH 등, 202 REJECTED 포함)는 readSuccessEnvelope가 meta를 돌려주지 않아 traceId가 없다. V3도 같다. 검증: desktop batch에서 확인. node scripts/run-vitest.ts run tests/integration/fileserver-upload.test.ts RED(이 커밋의 테스트 + 부모 src): Envelope failures 표 17행이 traceId "trace-1"이 없어 모두 실패한다. Refs: 1105/01-03
This commit is contained in:
@@ -397,11 +397,26 @@ describe("Fileserver multipart upload — Envelope failures", () => {
|
||||
effect,
|
||||
retryable: clientRetryable,
|
||||
operationId: "FILESERVER_UPLOAD",
|
||||
// 1105/01-03. The Envelope's meta.traceId, as V3 carries it.
|
||||
traceId: META.traceId,
|
||||
},
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
it("carries no traceId when the failure Envelope has none", async () => {
|
||||
const envelope = failureEnvelope("STORAGE_UNAVAILABLE", "TRANSIENT_DEPENDENCY", true);
|
||||
answer({
|
||||
status: 503,
|
||||
body: { success: envelope.success, error: envelope.error, meta: { requestId: "req-1" } },
|
||||
});
|
||||
|
||||
const result = await client().client.upload(upload());
|
||||
|
||||
expect(result.ok).toBe(false);
|
||||
expect(result.ok ? undefined : Object.hasOwn(result.error, "traceId")).toBe(false);
|
||||
});
|
||||
|
||||
it("409 IDEMPOTENT_IN_FLIGHT keeps the server's wait and asks for the same key", async () => {
|
||||
const captured = answer(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user