Skip to content

Commit b7936c5

Browse files
committed
fix(webapp): read run results from the owning store so triggerAndWait resolves for NEW runs
The run-result route built ApiRunResultPresenter with no run-ops read clients, so under the split it read a NEW-residency run's row on the control-plane database, found nothing, and returned 404. triggerAndWait and runs.retrieve().result then never resolved for NEW runs, stalling the parent. Wire the run-ops read clients the same way the batch-results route does.
1 parent 3adba9a commit b7936c5

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/webapp/app/routes/api.v1.runs.$runParam.result.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/server-runtime";
22
import { json } from "@remix-run/server-runtime";
33
import { z } from "zod";
44
import { ApiRunResultPresenter } from "~/presenters/v3/ApiRunResultPresenter.server";
5+
import { $replica, runOpsNewReplica, runOpsSplitReadEnabled } from "~/db.server";
56
import { authenticateApiRequest } from "~/services/apiAuth.server";
67
import { logger } from "~/services/logger.server";
78

@@ -27,7 +28,11 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
2728
const { runParam } = parsed.data;
2829

2930
try {
30-
const presenter = new ApiRunResultPresenter();
31+
const presenter = new ApiRunResultPresenter(undefined, undefined, {
32+
newClient: runOpsNewReplica,
33+
legacyReplica: $replica,
34+
splitEnabled: runOpsSplitReadEnabled,
35+
});
3136
const result = await presenter.call(runParam, authenticationResult.environment);
3237

3338
if (!result) {

0 commit comments

Comments
 (0)