@teamscala/service-boot 0.23.468 → 0.23.470
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -35,6 +35,7 @@ import { os } from "@orpc/server";
|
|
|
35
35
|
import * as v from "valibot";
|
|
36
36
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
37
37
|
import { queryRows } from "@teamscala/db/query-rows";
|
|
38
|
+
import { recordEvent } from "@teamscala/event-log/record-event";
|
|
38
39
|
import type { PrismaClient } from "@teamscala/db/client";
|
|
39
40
|
import { signAgreementAccessToken } from "@teamscala/document-signing/agreement-access-token";
|
|
40
41
|
import {
|
|
@@ -316,9 +317,32 @@ export const publicAgreementRouter = {
|
|
|
316
317
|
error: "This agreement has no signers recorded and cannot be signed.",
|
|
317
318
|
};
|
|
318
319
|
} catch (err) {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
321
|
+
log.error(`[publicAgreement.sign] failed: ${detail}`);
|
|
322
|
+
// A LOG LINE IS NOT A RECORD. Measured 2026-09-03: signing was broken
|
|
323
|
+
// for every signer for hours -- first a 404 on the procedure, then a
|
|
324
|
+
// Prisma 8 codec rejecting the timestamp write -- and error_logs held
|
|
325
|
+
// ZERO rows the whole time. The page returned 200, the service was
|
|
326
|
+
// running, the deploy was green, and the signer saw only "Could not
|
|
327
|
+
// submit your signature.", which reads as transient and invites a
|
|
328
|
+
// retry that fails identically. The failure was discovered by a human
|
|
329
|
+
// being unable to sign, which is the same shape as
|
|
330
|
+
// page-server.render.failed above and takes the same cure: emit a
|
|
331
|
+
// durable event so a surface can answer "is signing failing" without
|
|
332
|
+
// somebody attempting a signature.
|
|
333
|
+
//
|
|
334
|
+
// Fire-and-forget and last: telemetry may never change what the signer
|
|
335
|
+
// is served, and this path is already handling a failure
|
|
336
|
+
// (observability-is-passive). The agreement id and the signer role
|
|
337
|
+
// make a recorded event lead to the specific failure.
|
|
338
|
+
recordEvent({
|
|
339
|
+
kind: "agreement.sign.failed",
|
|
340
|
+
payload: {
|
|
341
|
+
agreementId,
|
|
342
|
+
error: detail.slice(0, 500),
|
|
343
|
+
errorName: err instanceof Error ? err.name : "unknown",
|
|
344
|
+
},
|
|
345
|
+
});
|
|
322
346
|
return { ok: false as const, error: "Could not submit your signature." };
|
|
323
347
|
}
|
|
324
348
|
}),
|
package/src/mount-orpc-router.ts
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
import { join } from "node:path";
|
|
13
13
|
import { getAppLogger } from "@teamscala/logger/app-loggers";
|
|
14
|
-
import { registerFnRouters } from "./fn-routers/index.ts";
|
|
15
14
|
import type { InjectedDb8 } from "@teamscala/db/db8-registry";
|
|
16
15
|
import type { Hono } from "hono";
|
|
17
16
|
import { bodyLimit } from "hono/body-limit";
|
|
@@ -30,7 +29,11 @@ export async function mountOrpcRouter(
|
|
|
30
29
|
serviceSlug: string,
|
|
31
30
|
): Promise<OrpcMountResult | null> {
|
|
32
31
|
const log = getAppLogger();
|
|
33
|
-
registerFnRouters()
|
|
32
|
+
// registerFnRouters() is retired: the row-composed bundle (orpc-bundle from
|
|
33
|
+
// api_route rows) is the sole fn source. The handwritten registration is
|
|
34
|
+
// fully shadowed by generated.fn (all families have rows) — keeping it
|
|
35
|
+
// would block generated-only procedures (auth, cacheAdmin, regions,
|
|
36
|
+
// realtime) from serving.
|
|
34
37
|
const routerPath = join(
|
|
35
38
|
process.cwd(),
|
|
36
39
|
"prisma/generated/orpc/routers/index.ts",
|