fix: clarify todo-note route misses
This commit is contained in:
+5
-2
@@ -1780,6 +1780,9 @@ function runTodoNoteRouteDiagnosticChecks(): { ok: boolean; detail: unknown } {
|
||||
// 1) Bad path: CLI must rewrite the misleading 404 to the structured diagnostic.
|
||||
const badPathRewrite = runTodoNoteCliProbe(["/api/instances/instance_probe_bad/todos", "--method", "POST", "--body-json", JSON.stringify({ title: "e2e-route-diagnostic" })]);
|
||||
const badPathBody = (badPathRewrite.payload as { data?: { body?: Record<string, unknown> } } | null)?.data?.body ?? null;
|
||||
const badPathData = (badPathRewrite.payload as { data?: Record<string, unknown> } | null)?.data ?? null;
|
||||
const badPathBodyRewritten = badPathBody?.bodyRewritten === true || badPathData?.bodyRewritten === true;
|
||||
const badPathUpstreamError = (badPathBody?.upstreamBody as { error?: string } | undefined)?.error ?? (badPathData?.upstreamBody as { error?: string } | undefined)?.error;
|
||||
const rewriteOk = (
|
||||
badPathRewrite.exitCode === 1
|
||||
&& badPathBody !== null
|
||||
@@ -1791,8 +1794,8 @@ function runTodoNoteRouteDiagnosticChecks(): { ok: boolean; detail: unknown } {
|
||||
&& (badPathBody.writableApiEndpoints as Array<{ path?: string }>).some((endpoint) => endpoint.path === "/api/instances/:instanceId/actions")
|
||||
&& Array.isArray(badPathBody.actionTypes)
|
||||
&& (badPathBody.actionTypes as string[]).includes("addTodo")
|
||||
&& (badPathRewrite.payload as { data?: { bodyRewritten?: boolean } } | null)?.data?.bodyRewritten === true
|
||||
&& (badPathRewrite.payload as { data?: { upstreamBody?: { error?: string } } } | null)?.data?.upstreamBody?.error === "Todo Note is running in backend-only mode"
|
||||
&& badPathBodyRewritten
|
||||
&& badPathUpstreamError === "Todo Note is running in backend-only mode"
|
||||
);
|
||||
if (!rewriteOk) issues.push("bad-path-rewrite");
|
||||
// 2) --check-path matched: POST /api/instances must succeed and return matched=true.
|
||||
|
||||
Reference in New Issue
Block a user