Skip to content

Commit 4713776

Browse files
d-csclaude
andcommitted
fix(run-ops split): wire batch-results route with split read-through deps
The api.v1.batches.$batchParam.results route constructed ApiBatchResultsPresenter with no read-through deps, collapsing call() to a passthrough read off the control-plane replica only. A NEW-resident (ksuid) batch on the dedicated run-ops DB was invisible to that read and the route returned 404. Wire the presenter with splitEnabled + newClient + legacyReplica, mirroring the batch-list and waitpoint token read routes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 030f177 commit 4713776

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

apps/webapp/app/routes/api.v1.batches.$batchParam.results.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { LoaderFunctionArgs } from "@remix-run/server-runtime";
22
import { json } from "@remix-run/server-runtime";
33
import { z } from "zod";
4+
import { $replica, runOpsNewReplica, runOpsSplitReadEnabled } from "~/db.server";
45
import { ApiBatchResultsPresenter } from "~/presenters/v3/ApiBatchResultsPresenter.server";
56
import { authenticateApiRequest } from "~/services/apiAuth.server";
67
import { logger } from "~/services/logger.server";
@@ -28,7 +29,11 @@ export async function loader({ request, params }: LoaderFunctionArgs) {
2829
const { batchParam } = parsed.data;
2930

3031
try {
31-
const presenter = new ApiBatchResultsPresenter();
32+
const presenter = new ApiBatchResultsPresenter(undefined, undefined, {
33+
newClient: runOpsNewReplica,
34+
legacyReplica: $replica,
35+
splitEnabled: runOpsSplitReadEnabled,
36+
});
3237
const result = await presenter.call(batchParam, authenticationResult.environment);
3338

3439
if (!result) {

0 commit comments

Comments
 (0)